pub struct ModbusSlave<A: ApplicationLayer, P: PhysicalLayer> {
pub models: Arc<Mutex<HashMap<u8, Arc<dyn ModbusSlaveModel>>>>,
pub concurrent: bool,
/* private fields */
}Fields§
§models: Arc<Mutex<HashMap<u8, Arc<dyn ModbusSlaveModel>>>>§concurrent: boolImplementations§
Source§impl<A: ApplicationLayer + 'static, P: PhysicalLayer + 'static> ModbusSlave<A, P>
impl<A: ApplicationLayer + 'static, P: PhysicalLayer + 'static> ModbusSlave<A, P>
pub fn new(application: Arc<A>, physical: Arc<P>) -> Self
pub fn with_options( application: Arc<A>, physical: Arc<P>, options: ModbusSlaveOptions, ) -> Self
pub fn add(&self, model: Box<dyn ModbusSlaveModel>)
pub fn remove(&self, unit: u8)
pub fn is_open(&self) -> bool
pub fn is_destroyed(&self) -> bool
pub async fn open(&self, options: P::OpenOptions) -> Result<(), ModbusError>
pub async fn close(&self) -> Result<(), ModbusError>
pub async fn destroy(&self)
pub fn add_custom_function_code(&self, cfc: CustomFunctionCode)
pub fn remove_custom_function_code(&self, fc: u8)
Auto Trait Implementations§
impl<A, P> !Freeze for ModbusSlave<A, P>
impl<A, P> !RefUnwindSafe for ModbusSlave<A, P>
impl<A, P> Send for ModbusSlave<A, P>
impl<A, P> Sync for ModbusSlave<A, P>
impl<A, P> Unpin for ModbusSlave<A, P>
impl<A, P> UnsafeUnpin for ModbusSlave<A, P>
impl<A, P> !UnwindSafe for ModbusSlave<A, P>
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