Struct coap_lite::Subject[][src]

pub struct Subject<Endpoint: Display + PartialEq> { /* fields omitted */ }

Keeps track of the state of the observed resources.

Implementations

impl<Endpoint: Display + PartialEq + Clone> Subject<Endpoint>[src]

pub fn register(&mut self, request: &CoapRequest<Endpoint>)[src]

Registers an observer interested in a resource.

pub fn deregister(&mut self, request: &CoapRequest<Endpoint>)[src]

pub fn resource_changed(&mut self, resource: &str)[src]

Updates the resource information after having notified the observers.

It increments the resource sequence and counter of unacknowledged updates.

pub fn acknowledge(&mut self, request: &CoapRequest<Endpoint>)[src]

Resets the counter of unacknowledged updates for a resource observer.

pub fn get_resource(&self, resource: &str) -> Option<&Resource<Endpoint>>[src]

Gets the tracked resources.

pub fn get_resource_observers(
    &self,
    resource: &str
) -> Option<Vec<&Observer<Endpoint>>>
[src]

Gets the observers of a resource.

pub fn set_unacknowledged_limit(&mut self, limit: u8)[src]

Sets the limit of unacknowledged updates before removing an observer.

Trait Implementations

impl<Endpoint: Display + PartialEq + Clone> Default for Subject<Endpoint>[src]

Auto Trait Implementations

impl<Endpoint> RefUnwindSafe for Subject<Endpoint> where
    Endpoint: RefUnwindSafe
[src]

impl<Endpoint> Send for Subject<Endpoint> where
    Endpoint: Send
[src]

impl<Endpoint> Sync for Subject<Endpoint> where
    Endpoint: Sync
[src]

impl<Endpoint> Unpin for Subject<Endpoint> where
    Endpoint: Unpin
[src]

impl<Endpoint> UnwindSafe for Subject<Endpoint> where
    Endpoint: RefUnwindSafe + UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.