[−][src]Struct tokio_modbus::client::util::SharedContext
Reconnectable environment with a shared context.
Methods
impl SharedContext
[src]
pub fn new(
inital_context: Option<Context>,
new_context: Box<dyn NewContext>
) -> Self
[src]
inital_context: Option<Context>,
new_context: Box<dyn NewContext>
) -> Self
Create a new instance with an optional, initial context and a trait object for reconnecting the shared context on demand.
pub fn is_connected(&self) -> bool
[src]
Checks if a shared context is available.
pub fn share_context(&self) -> Option<Rc<RefCell<Context>>>
[src]
Try to obtain a shared context reference. The result is None
if no context is available, i.e. if the shared context is not
connected.
The result should only be used temporarily for the next asynchronous request and must not be reused later!
Auto Trait Implementations
impl !Send for SharedContext
impl !Sync for SharedContext
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,