pub struct EnvironmentGuard { /* private fields */ }Expand description
Environment safety guard.
Implementations§
Source§impl EnvironmentGuard
impl EnvironmentGuard
Sourcepub fn paper_only() -> EnvironmentGuard
pub fn paper_only() -> EnvironmentGuard
Create new guard for paper trading only.
Sourcepub fn allow_live(environment: TradingEnvironment) -> EnvironmentGuard
pub fn allow_live(environment: TradingEnvironment) -> EnvironmentGuard
Create new guard allowing live trading.
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
Check if current operation is allowed.
Sourcepub fn environment(&self) -> TradingEnvironment
pub fn environment(&self) -> TradingEnvironment
Get current environment.
Trait Implementations§
Source§impl Clone for EnvironmentGuard
impl Clone for EnvironmentGuard
Source§fn clone(&self) -> EnvironmentGuard
fn clone(&self) -> EnvironmentGuard
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EnvironmentGuard
impl RefUnwindSafe for EnvironmentGuard
impl Send for EnvironmentGuard
impl Sync for EnvironmentGuard
impl Unpin for EnvironmentGuard
impl UnwindSafe for EnvironmentGuard
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