pub struct ServiceIdentity { /* private fields */ }Expand description
Who the service is: the identity published in service.json and used for ranking and takeover.
Implementations§
Source§impl ServiceIdentity
impl ServiceIdentity
Sourcepub fn new(
service: &str,
role: &str,
rank: u8,
version: &str,
) -> Result<Self, RegistrationError>
pub fn new( service: &str, role: &str, rank: u8, version: &str, ) -> Result<Self, RegistrationError>
service must be a valid service name (valid_service_name); role and version must
be short, non-empty and free of control characters. Lower rank wins a takeover.
pub fn service(&self) -> &str
pub fn role(&self) -> &str
pub fn rank(&self) -> u8
pub fn version(&self) -> &str
Sourcepub fn to_config(&self) -> ServiceConfig
pub fn to_config(&self) -> ServiceConfig
The host configuration for this identity. The allowlist is empty here and replaced by the one the method table implies when the service starts.
Trait Implementations§
Source§impl Clone for ServiceIdentity
impl Clone for ServiceIdentity
Source§impl Debug for ServiceIdentity
impl Debug for ServiceIdentity
impl Eq for ServiceIdentity
Source§impl PartialEq for ServiceIdentity
impl PartialEq for ServiceIdentity
impl StructuralPartialEq for ServiceIdentity
Auto Trait Implementations§
impl Freeze for ServiceIdentity
impl RefUnwindSafe for ServiceIdentity
impl Send for ServiceIdentity
impl Sync for ServiceIdentity
impl Unpin for ServiceIdentity
impl UnsafeUnpin for ServiceIdentity
impl UnwindSafe for ServiceIdentity
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