Struct pidgeon_cli::service::modbus::connection::Connection
source · pub(crate) struct Connection {
device: Device,
ctx: Option<Context>,
slave: Option<u8>,
}Fields§
§device: Device§ctx: Option<Context>§slave: Option<u8>Implementations§
source§impl Connection
impl Connection
pub(crate) fn new(device: Device) -> Self
pub(crate) async fn ensure_connected( &mut self, slave: Option<u8>, ) -> Result<(), ConnectError>
source§impl Connection
impl Connection
pub(crate) async fn read( &mut self, slave: Option<u8>, span: SimpleSpan, timeout: Duration, ) -> Result<Vec<u16>, ReadError>
pub(crate) async fn write( &mut self, slave: Option<u8>, record: SimpleRecord, timeout: Duration, ) -> Result<(), WriteError>
async fn simple_read_impl( &mut self, slave: Option<u8>, span: SimpleSpan, timeout: Duration, ) -> Result<Vec<u16>, ReadError>
async fn simple_write_impl( &mut self, slave: Option<u8>, record: SimpleRecord, timeout: Duration, ) -> Result<(), WriteError>
async fn simple_read_impl_connected( ctx: &mut Context, slave: Option<u8>, span: SimpleSpan, timeout: Duration, ) -> Result<Vec<u16>, ReadError>
async fn simple_write_impl_connected( ctx: &mut Context, slave: Option<u8>, record: SimpleRecord, timeout: Duration, ) -> Result<(), WriteError>
source§impl Connection
impl Connection
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl !Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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