DeviceManager

Struct DeviceManager 

Source
pub struct DeviceManager {
    pub device: HashMap<Uuid, Device>,
    /* private fields */
}

Fields§

§device: HashMap<Uuid, Device>

Implementations§

Source§

impl DeviceManager

Source

pub async fn continuous_mode_start( &mut self, subscriber: Receiver<ProtocolMessage>, device_id: Uuid, device_type: DeviceSelection, ) -> Option<JoinHandle<()>>

Source

pub async fn continuous_mode_startup_routine( &self, device_id: Uuid, device_type: DeviceSelection, ) -> Result<(), ManagerError>

Source

pub async fn continuous_mode_shutdown_routine( &self, device_id: Uuid, device_type: DeviceSelection, ) -> Result<(), ManagerError>

Source

pub fn ping1d_continuous_mode_helper(msg: ProtocolMessage, device_id: Uuid)

Source

pub fn ping360_continuous_mode_helper(msg: Messages, device_id: Uuid)

Source

pub fn handle_error_continuous_mode(error: RecvError, device_id: Uuid)

Source§

impl DeviceManager

Source

pub fn check_device_uuid(&self, device_id: Uuid) -> Result<(), ManagerError>

Source

pub fn get_device(&self, device_id: Uuid) -> Result<&Device, ManagerError>

Source

pub async fn get_device_handler( &self, device_id: Uuid, ) -> Result<Answer, ManagerError>

Source

pub fn check_device_status( &self, device_id: Uuid, valid_statuses: &[DeviceStatus], ) -> Result<(), ManagerError>

Source

pub fn get_mut_device( &mut self, device_id: Uuid, ) -> Result<&mut Device, ManagerError>

Source

pub fn get_device_type( &self, device_id: Uuid, ) -> Result<DeviceSelection, ManagerError>

Source

pub fn extract_handler( &self, device_handler: Answer, ) -> Result<DeviceActorHandler, ManagerError>

Source

pub async fn get_subscriber( &self, device_id: Uuid, ) -> Result<Receiver<ProtocolMessage>, ManagerError>

Source§

impl DeviceManager

Source

pub fn new(size: usize) -> (Self, ManagerActorHandler)

Source

pub async fn run(self)

Source

pub async fn update_devices_status(&mut self)

Source

pub async fn create( &mut self, source: SourceSelection, device_selection: DeviceSelection, ) -> Result<Answer, ManagerError>

Source

pub async fn auto_create(&mut self) -> Result<Answer, ManagerError>

Source

pub async fn list(&self) -> Result<Answer, ManagerError>

Source

pub async fn info(&self, device_id: Uuid) -> Result<Answer, ManagerError>

Source

pub async fn delete(&mut self, device_id: Uuid) -> Result<Answer, ManagerError>

Source

pub async fn continuous_mode( &mut self, device_id: Uuid, ) -> Result<Answer, ManagerError>

Source

pub async fn continuous_mode_off( &mut self, device_id: Uuid, ) -> Result<Answer, ManagerError>

Source

pub async fn modify_device( &mut self, request: ModifyDevice, ) -> Result<Answer, ManagerError>

Source

pub async fn modify_device_ip( &mut self, ip: Ipv4Addr, destination: Ipv4Addr, ) -> Result<(), ManagerError>

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> 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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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