pub struct Connection<B: Driver> { /* private fields */ }Expand description
explicit messaging connection
Implementations§
Source§impl<B: Driver<Endpoint = SocketAddrV4>> Connection<B>
impl<B: Driver<Endpoint = SocketAddrV4>> Connection<B>
Sourcepub async fn new_host_lookup(
host: impl AsRef<str>,
options: OpenOptions,
) -> Result<Self>
pub async fn new_host_lookup( host: impl AsRef<str>, options: OpenOptions, ) -> Result<Self>
create connection from specified host, with default port if port not specified
Source§impl<B: Driver> Connection<B>
impl<B: Driver> Connection<B>
Sourcepub fn new(addr: B::Endpoint, options: OpenOptions) -> Self
pub fn new(addr: B::Endpoint, options: OpenOptions) -> Self
Create connection
Sourcepub fn remote_endpoint(&self) -> &B::Endpoint
pub fn remote_endpoint(&self) -> &B::Endpoint
current remote endpoint, driver specific
Sourcepub fn connection_id(&self) -> Option<u32>
pub fn connection_id(&self) -> Option<u32>
CIP connection id
Trait Implementations§
Source§impl<B: Driver> Heartbeat for Connection<B>
impl<B: Driver> Heartbeat for Connection<B>
Source§impl<B: Driver> MessageService for Connection<B>
impl<B: Driver> MessageService for Connection<B>
Source§fn send<'de, 'life0, 'async_trait, P, D, R>(
&'life0 mut self,
mr: MessageRequest<P, D>,
) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>
fn send<'de, 'life0, 'async_trait, P, D, R>( &'life0 mut self, mr: MessageRequest<P, D>, ) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>
connected send
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
close current connection and underline transport
type Error = ClientError
Auto Trait Implementations§
impl<B> !Freeze for Connection<B>
impl<B> RefUnwindSafe for Connection<B>
impl<B> Send for Connection<B>
impl<B> Sync for Connection<B>
impl<B> Unpin for Connection<B>
impl<B> UnwindSafe for Connection<B>
Blanket Implementations§
Source§impl<T> AbTemplateService for Twhere
T: MessageService<Error = ClientError>,
impl<T> AbTemplateService for Twhere
T: MessageService<Error = ClientError>,
Source§fn find_template<'life0, 'async_trait>(
&'life0 mut self,
instance_id: u16,
) -> Pin<Box<dyn Future<Output = Result<Template, ClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn find_template<'life0, 'async_trait>(
&'life0 mut self,
instance_id: u16,
) -> Pin<Box<dyn Future<Output = Result<Template, ClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fetch template instance for specified instance id
Source§fn read_template<'a>(&'a mut self, template: &Template) -> TemplateRead<'a, T>
fn read_template<'a>(&'a mut self, template: &Template) -> TemplateRead<'a, T>
read template definition
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> CommonServices for Twhere
T: MessageService,
impl<T> CommonServices for Twhere
T: MessageService,
Source§fn get_attribute_all<'de, 'life0, 'async_trait, R>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn get_attribute_all<'de, 'life0, 'async_trait, R>( &'life0 mut self, path: EPath, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Get_Attribute_All service
Source§fn set_attribute_all<'life0, 'async_trait, D>(
&'life0 mut self,
path: EPath,
attrs: D,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
fn set_attribute_all<'life0, 'async_trait, D>( &'life0 mut self, path: EPath, attrs: D, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
invoke the Set_Attribute_All service
Source§fn get_attribute_list<'de, 'life0, 'life1, 'async_trait, R>(
&'life0 mut self,
path: EPath,
attrs: &'life1 [u16],
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn get_attribute_list<'de, 'life0, 'life1, 'async_trait, R>( &'life0 mut self, path: EPath, attrs: &'life1 [u16], ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Get_Attribute_List
Source§fn set_attribute_list<'de, 'life0, 'async_trait, D, R>(
&'life0 mut self,
path: EPath,
attrs: D,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn set_attribute_list<'de, 'life0, 'async_trait, D, R>( &'life0 mut self, path: EPath, attrs: D, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Set_Attribute_List service
Source§fn reset<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn reset<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Reset service
Source§fn start<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Start service
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Stop service
Source§fn create<'de, 'life0, 'async_trait, D, R>(
&'life0 mut self,
path: EPath,
data: D,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn create<'de, 'life0, 'async_trait, D, R>( &'life0 mut self, path: EPath, data: D, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Create service
Source§fn delete<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Delete service
Source§fn apply_attributes<'de, 'life0, 'async_trait, D, R>(
&'life0 mut self,
path: EPath,
data: D,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn apply_attributes<'de, 'life0, 'async_trait, D, R>( &'life0 mut self, path: EPath, data: D, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Apply_Attributes service
Source§fn get_attribute_single<'de, 'life0, 'async_trait, R>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn get_attribute_single<'de, 'life0, 'async_trait, R>( &'life0 mut self, path: EPath, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Get_Attribute_Single service
Source§fn set_attribute_single<'life0, 'async_trait, D>(
&'life0 mut self,
path: EPath,
data: D,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
fn set_attribute_single<'life0, 'async_trait, D>( &'life0 mut self, path: EPath, data: D, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
invoke the Set_Attribute_Single service
Source§fn restore<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn restore<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Restore service
Source§fn save<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn save<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Save service
Source§fn no_operation<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn no_operation<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Nop service
Source§fn get_member<'de, 'life0, 'async_trait, R>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn get_member<'de, 'life0, 'async_trait, R>( &'life0 mut self, path: EPath, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Get_Member service
Source§fn set_member<'de, 'life0, 'async_trait, D, R>(
&'life0 mut self,
path: EPath,
data: D,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn set_member<'de, 'life0, 'async_trait, D, R>( &'life0 mut self, path: EPath, data: D, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Set_Member service
Source§fn insert_member<'de, 'life0, 'async_trait, D, R>(
&'life0 mut self,
path: EPath,
data: D,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn insert_member<'de, 'life0, 'async_trait, D, R>( &'life0 mut self, path: EPath, data: D, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
invoke the Insert_Member service
Source§fn remove_member<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn remove_member<'life0, 'async_trait>(
&'life0 mut self,
path: EPath,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
invoke the Remove_Member service