[−][src]Struct dsf_core::service::Service
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]
U: Fn(&mut Body, &mut Vec<Options>, &mut PrivateOptions),
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]
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]
&self,
msg: Message,
buff: T
) -> Result<usize, Error>
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]
&mut self,
buff: T
) -> Result<(usize, Page), Error>
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]
&mut self,
options: SecondaryOptions,
buff: T
) -> Result<(usize, Page), Error>
Secondary generates a secondary page using this service to be attached to the provided service ID
fn publish_data<T: AsRef<[u8]> + AsMut<[u8]>>(
&mut self,
options: DataOptions,
buff: T
) -> Result<(usize, Page), Error>[src]
&mut self,
options: DataOptions,
buff: T
) -> Result<(usize, Page), Error>
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
fn validate_page(&mut self, page: &Page) -> Result<(), Error>[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
T: InitializableFromZeroed + ?Sized,
fn clear(&mut self)
impl<T> From<T> for T[src]
impl<T> InitializableFromZeroed for T where
T: Default,
T: Default,
unsafe fn initialize(place: *mut T)
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,