AssociationHandle

Struct AssociationHandle 

Source
pub struct AssociationHandle { /* private fields */ }
Expand description

Handle used to make requests against a particular outstation associated with the master channel

Implementations§

Source§

impl AssociationHandle

Source

pub fn address(&self) -> EndpointAddress

retrieve the outstation address of the association

Source

pub async fn add_poll( &mut self, request: ReadRequest, period: Duration, ) -> Result<PollHandle, PollError>

Add a poll to the association

  • request defines what data is being requested
  • period defines how often the READ operation is performed
Source

pub async fn remove(self) -> Result<(), Shutdown>

Remove the association from the master

Source

pub async fn read(&mut self, request: ReadRequest) -> Result<(), TaskError>

Perform an asynchronous READ request

If successful, the ReadHandler will process the received measurement data

Source

pub async fn send_and_expect_empty_response( &mut self, function: FunctionCode, headers: Headers, ) -> Result<(), WriteError>

Perform an asynchronous request with the specified function code and object headers

This is useful for constructing various types of WRITE and FREEZE operations where an empty response is expected from the outstation, and the only indication of success are bits in IIN.2

Source

pub async fn read_with_handler( &mut self, request: ReadRequest, handler: Box<dyn ReadHandler>, ) -> Result<(), TaskError>

Perform an asynchronous READ request with a custom read handler

If successful, the custom ReadHandler will process the received measurement data

Source

pub async fn operate( &mut self, mode: CommandMode, headers: CommandHeaders, ) -> Result<(), CommandError>

Perform an asynchronous operate request

The actual function code used depends on the value of the CommandMode.

Source

pub async fn warm_restart(&mut self) -> Result<Duration, TaskError>

Perform a WARM_RESTART operation

Returns the delay from the outstation’s response as a Duration

Source

pub async fn cold_restart(&mut self) -> Result<Duration, TaskError>

Perform a COLD_RESTART operation

Returns the delay from the outstation’s response as a Duration

Source

pub async fn synchronize_time( &mut self, procedure: TimeSyncProcedure, ) -> Result<(), TimeSyncError>

Perform the specified time synchronization operation

Source

pub async fn write_dead_bands( &mut self, headers: Vec<DeadBandHeader>, ) -> Result<(), WriteError>

Perform write one or more headers of analog input dead-bands to the outstation

Trigger the master to issue a REQUEST_LINK_STATUS function in advance of the link status timeout

This function is provided for testing purposes. Using the configured link status timeout is the preferred so that the master automatically issues these requests.

If a TaskError::UnexpectedResponseHeaders is returned, the link might be alive but it didn’t answer with the expected LINK_STATUS.

Source

pub async fn get_file_auth_key( &mut self, credentials: FileCredentials, ) -> Result<AuthKey, FileError>

Obtain an AuthKey from the outstation which may then be used to open the file.

Source

pub async fn open_file<T: ToString>( &mut self, file_name: T, auth_key: AuthKey, permissions: Permissions, file_size: u32, file_mode: FileMode, max_block_size: u16, ) -> Result<OpenFile, FileError>

Open a file on the outstation with the requested parameters

Source

pub async fn write_file_block( &mut self, handle: FileHandle, block_number: BlockNumber, block_data: Vec<u8>, ) -> Result<(), FileError>

Write a file block to the outstation

Source

pub async fn close_file(&mut self, handle: FileHandle) -> Result<(), FileError>

Close a file on the outstation

Source

pub async fn read_file<T: ToString>( &mut self, remote_file_path: T, config: FileReadConfig, reader: Box<dyn FileReader>, credentials: Option<FileCredentials>, ) -> Result<(), Shutdown>

Start an operation to READ a file from the outstation using a FileReader to receive data

Source

pub async fn read_directory<T: ToString>( &mut self, dir_path: T, config: DirReadConfig, credentials: Option<FileCredentials>, ) -> Result<Vec<FileInfo>, FileError>

Read a file directory

Source

pub async fn get_file_info<T: ToString>( &mut self, file_path: T, ) -> Result<FileInfo, FileError>

Get information about a file

Trait Implementations§

Source§

impl Clone for AssociationHandle

Source§

fn clone(&self) -> AssociationHandle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AssociationHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more