pub struct Service { /* private fields */ }
Expand description
Generic Service Type. This provides the basis for all services in DSR.
Services should be constructed using the ServiceBuilder type
Implementations§
Source§impl Service
impl Service
pub fn id(&self) -> Id
Sourcepub fn update<U>(&mut self, update_fn: U) -> Result<(), Error>
pub fn update<U>(&mut self, update_fn: U) -> Result<(), Error>
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
pub fn public_key(&self) -> PublicKey
pub fn private_key(&self) -> Option<PrivateKey>
pub fn secret_key(&self) -> Option<SecretKey>
pub fn set_private_key(&mut self, key: Option<PrivateKey>)
pub fn set_secret_key(&mut self, key: Option<SecretKey>)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Service
impl<'de> Deserialize<'de> for Service
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Net for Service
impl Net for Service
Source§fn build_request(
&self,
request_id: u16,
kind: RequestKind,
flags: Flags,
) -> Base
fn build_request( &self, request_id: u16, kind: RequestKind, flags: Flags, ) -> Base
Generate a protocol request object from a request message
Source§fn build_response(
&self,
request_id: u16,
kind: ResponseKind,
flags: Flags,
) -> Base
fn build_response( &self, request_id: u16, kind: ResponseKind, flags: Flags, ) -> Base
Generate a protocol response object from a response message (and it’s associated request)
Source§impl Publisher for Service
impl Publisher for Service
Source§fn publish_primary<T: AsRef<[u8]> + AsMut<[u8]>>(
&mut self,
buff: T,
) -> Result<(usize, Page), Error>
fn publish_primary<T: AsRef<[u8]> + AsMut<[u8]>>( &mut self, buff: T, ) -> Result<(usize, Page), Error>
Publish generates a page to publishing for the given service.
Source§impl Subscriber for Service
impl Subscriber for Service
impl StructuralPartialEq for Service
Auto Trait Implementations§
impl Freeze for Service
impl RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl Unpin for Service
impl UnwindSafe for Service
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