Skip to main content

ChainState

Struct ChainState 

pub struct ChainState { /* private fields */ }

Implementations§

§

impl ChainState

pub fn from_snapshot(snapshot: ChainSnapshot) -> Result<Self, FerroRiskError>

pub fn metadata(&self) -> &ChainMetadata

pub fn revision(&self) -> u64

pub fn contract_count(&self) -> usize

pub fn is_empty(&self) -> bool

pub fn contract( &self, contract_id: ChainContractId, ) -> Option<&ChainContractSnapshot>

pub fn contracts(&self) -> impl Iterator<Item = &ChainContractSnapshot>

pub fn expiries(&self) -> Vec<f64>

pub fn expiry_revision( &self, expiry: f64, ) -> Result<Option<u64>, FerroRiskError>

pub fn strike_revision( &self, expiry: f64, strike: f64, ) -> Result<Option<u64>, FerroRiskError>

pub fn contracts_at_expiry( &self, expiry: f64, ) -> Result<Vec<&ChainContractSnapshot>, FerroRiskError>

pub fn contracts_at_expiry_and_strike( &self, expiry: f64, strike: f64, ) -> Result<Vec<&ChainContractSnapshot>, FerroRiskError>

pub fn replace_snapshot( &mut self, snapshot: ChainSnapshot, ) -> Result<ChainRefreshReport, FerroRiskError>

pub fn apply_update_batch( &mut self, batch: ChainUpdateBatch, ) -> Result<ChainRefreshReport, FerroRiskError>

Trait Implementations§

§

impl Clone for ChainState

§

fn clone(&self) -> ChainState

1.0.0 (const: )§

fn clone_from(&mut self, source: &Self)

§

impl Debug for ChainState

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
§

impl<T> From<T> for T

§

fn from(t: T) -> T

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

§

impl<T> IntoEither for T

§

fn into_either(self, into_left: bool) -> Either<Self, Self>

§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

§

impl<T> Pointable for T

§

const ALIGN: usize

§

type Init = T

§

unsafe fn init(init: <T as Pointable>::Init) -> usize

§

unsafe fn deref<'a>(ptr: usize) -> &'a T

§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

§

unsafe fn drop(ptr: usize)

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

§

fn to_owned(&self) -> T

§

fn clone_into(&self, target: &mut T)

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>