pub struct ServerContext { /* private fields */ }Expand description
Shared server context containing unit registry and fallback datastore.
Implementations§
Source§impl ServerContext
impl ServerContext
pub fn new(default_space: SharedAddressSpace) -> Self
pub fn register(&self, device: Arc<DeviceContext>) -> Option<Arc<DeviceContext>>
pub fn remove(&self, unit_id: u8) -> Option<Arc<DeviceContext>>
pub fn device(&self, unit_id: u8) -> Option<Arc<DeviceContext>>
pub fn devices(&self) -> Vec<Arc<DeviceContext>>
pub fn set_default_space(&self, default_space: SharedAddressSpace)
pub fn default_space(&self) -> SharedAddressSpace
pub fn set_broadcast_enabled(&self, enabled: bool)
pub fn broadcast_enabled(&self) -> bool
pub fn set_broadcast_policy(&self, policy: BroadcastPolicy)
pub fn broadcast_policy(&self) -> BroadcastPolicy
pub fn target_for_unit(&self, unit_id: u8) -> Option<RequestTarget>
pub fn broadcast_targets(&self) -> Vec<RequestTarget>
pub fn fallback_target(&self, unit_id: u8) -> RequestTarget
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ServerContext
impl !RefUnwindSafe for ServerContext
impl Send for ServerContext
impl Sync for ServerContext
impl Unpin for ServerContext
impl UnsafeUnpin for ServerContext
impl !UnwindSafe for ServerContext
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