pub struct State {
pub signer: Option<Signer>,
pub asset_nonces: Option<HashMap<String, Vec<u32>>>,
pub markets: Option<HashMap<String, Market>>,
pub assets: Option<Vec<Asset>>,
pub remaining_orders: AtomicU64,
pub affiliate_code: Option<String>,
pub assets_nonces_refresh: bool,
pub dont_sign_states: bool,
pub place_order_semaphore: Arc<Semaphore>,
pub sign_all_states_semaphore: Arc<Semaphore>,
pub k1_fill_pool_semaphore: Arc<Semaphore>,
pub r1_fill_pool_semaphore: Arc<Semaphore>,
}Expand description
Client state shared across the protocol.
Fields§
§signer: Option<Signer>§asset_nonces: Option<HashMap<String, Vec<u32>>>§markets: Option<HashMap<String, Market>>§assets: Option<Vec<Asset>>§remaining_orders: AtomicU64§affiliate_code: Option<String>§assets_nonces_refresh: bool§dont_sign_states: bool§place_order_semaphore: Arc<Semaphore>§sign_all_states_semaphore: Arc<Semaphore>§k1_fill_pool_semaphore: Arc<Semaphore>§r1_fill_pool_semaphore: Arc<Semaphore>Implementations§
Source§impl State
impl State
pub fn new(signer: Option<Signer>) -> Self
pub fn from_keys_path(keys_path: Option<&str>) -> Result<Self>
pub fn from_keys(secret: &str, session: &str) -> Result<Self>
pub fn signer(&self) -> Result<&Signer>
pub fn get_market(&self, market_name: &str) -> Result<Market>
pub fn get_remaining_orders(&self) -> u64
pub fn set_remaining_orders(&self, n: u64)
pub fn decr_remaining_orders(&self)
Sourcepub fn acquire_fill_pool_schedules<'life_self, 'async_recursion>(
&'life_self self,
chains: Option<&'async_recursion Vec<Blockchain>>,
r_val_fill_pool_threshold: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(DhFillPoolRequest, OwnedSemaphorePermit)>>> + Send + 'async_recursion>>where
'life_self: 'async_recursion,
pub fn acquire_fill_pool_schedules<'life_self, 'async_recursion>(
&'life_self self,
chains: Option<&'async_recursion Vec<Blockchain>>,
r_val_fill_pool_threshold: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(DhFillPoolRequest, OwnedSemaphorePermit)>>> + Send + 'async_recursion>>where
'life_self: 'async_recursion,
Check if pools need a refill
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for State
impl !RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl !UnwindSafe for State
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more