[][src]Struct dsf_core::service::Service

pub struct Service { /* fields omitted */ }

Generic Service Type. This provides the basis for all services in DSR.

Services should be constructed using the ServiceBuilder type

Implementations

impl Service[src]

pub fn id(&self) -> Id[src]

pub fn update<U>(&mut self, update_fn: U) -> Result<(), Error> where
    U: Fn(&mut Body, &mut Vec<Options>, &mut PrivateOptions), 
[src]

Update a service. This allows in-place editing of descriptors and options and causes an update of the service version number as well as a reset of the data_index.

pub fn is_origin(&self) -> bool[src]

pub fn public_key(&self) -> PublicKey[src]

pub fn private_key(&self) -> Option<PrivateKey>[src]

pub fn secret_key(&self) -> Option<SecretKey>[src]

pub fn set_private_key(&mut self, key: Option<PrivateKey>)[src]

pub fn set_secret_key(&mut self, key: Option<SecretKey>)[src]

Trait Implementations

impl Clone for Service[src]

impl Debug for Service[src]

impl Default for Service[src]

fn default() -> Service[src]

Create a default / blank Service for further initialisation.

impl Net for Service[src]

fn build_request(&self, req: &Request) -> Base[src]

Generate a protocol request object from a request message

fn build_response(&self, req: &Request, _from: Address, resp: &Response) -> Base[src]

Generate a protocol response object from a response message (and it's associated request)

fn encode_message<T: AsRef<[u8]> + AsMut<[u8]>>(
    &self,
    msg: Message,
    buff: T
) -> Result<usize, Error>
[src]

Encode a message

impl PartialEq<Service> for Service[src]

impl Publisher for Service[src]

fn publish_primary<T: AsRef<[u8]> + AsMut<[u8]>>(
    &mut self,
    buff: T
) -> Result<(usize, Page), Error>
[src]

Publish generates a page to publishing for the given service.

fn publish_secondary<T: AsRef<[u8]> + AsMut<[u8]>>(
    &mut self,
    options: SecondaryOptions,
    buff: T
) -> Result<(usize, Page), Error>
[src]

Secondary generates a secondary page using this service to be attached to the provided service ID

impl StructuralPartialEq for Service[src]

impl Subscriber for Service[src]

fn load(page: &Page) -> Result<Service, Error>[src]

Create a service instance from a given page

fn apply_primary(&mut self, update: &Page) -> Result<bool, Error>[src]

Apply an upgrade to an existing service. This consumes a new page and updates the service instance

Auto Trait Implementations

impl RefUnwindSafe for Service

impl Send for Service

impl Sync for Service

impl Unpin for Service

impl UnwindSafe for Service

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> Clear for T where
    T: InitializableFromZeroed + ?Sized

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

impl<T> InitializableFromZeroed for T where
    T: Default

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.