pub struct ServiceDetails<T: Data> {
pub partition: Option<String>,
pub service_name: String,
pub data: T,
}Expand description
Details about a service. Requires the service feature.
Fields§
§partition: Option<String>The partition this principal exists in. If None, the current partition is assumed.
service_name: StringName of the service.
data: TPrincipal flavor-specific data.
Implementations§
source§impl<T: Data> ServiceDetails<T>
impl<T: Data> ServiceDetails<T>
sourcepub fn new<S>(
partition: Option<String>,
service_name: S,
data: T,
) -> Result<Self, PrincipalError>
pub fn new<S>( partition: Option<String>, service_name: S, data: T, ) -> Result<Self, PrincipalError>
Create a ServiceDetails object. Requires the service feature.
§Arguments
service_name: The name of the service. This must meet the following requirements or a PrincipalError::InvalidServiceName error will be returned:- The name must contain between 1 and 32 characters.
- The name must be composed to ASCII alphanumeric characters or one of
, - . = @ _.
data: Principal flavor-specific data.
If all of the requirements are met, a ServiceDetails object is returned. Otherwise, a PrincipalError error is returned.
Trait Implementations§
source§impl<T: Clone + Data> Clone for ServiceDetails<T>
impl<T: Clone + Data> Clone for ServiceDetails<T>
source§fn clone(&self) -> ServiceDetails<T>
fn clone(&self) -> ServiceDetails<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl From<ServiceDetails<Option<String>>> for ServiceDetails<()>
impl From<ServiceDetails<Option<String>>> for ServiceDetails<()>
source§fn from(from: ServiceDetails) -> ServiceDetails<()>
fn from(from: ServiceDetails) -> ServiceDetails<()>
Converts to this type from the input type.
source§impl<T: PartialEq + Data> PartialEq for ServiceDetails<T>
impl<T: PartialEq + Data> PartialEq for ServiceDetails<T>
source§fn eq(&self, other: &ServiceDetails<T>) -> bool
fn eq(&self, other: &ServiceDetails<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<T: Eq + Data> Eq for ServiceDetails<T>
impl<T: Data> StructuralPartialEq for ServiceDetails<T>
Auto Trait Implementations§
impl<T> Freeze for ServiceDetails<T>where
T: Freeze,
impl<T> RefUnwindSafe for ServiceDetails<T>where
T: RefUnwindSafe,
impl<T> Send for ServiceDetails<T>
impl<T> Sync for ServiceDetails<T>
impl<T> Unpin for ServiceDetails<T>where
T: Unpin,
impl<T> UnwindSafe for ServiceDetails<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)