pub struct ServiceId(pub u64, pub u64);Expand description
Represents the ID a service in the authentication process.
The ServiceId is a tuple of two u64 values, which can be used to uniquely identify a service.
The first u64 represents the main service ID, while the second u64 represents a sub-service or a specific instance of the service.
Tuple Fields§
§0: u64§1: u64Implementations§
Source§impl ServiceId
impl ServiceId
Sourcepub fn with_subservice(self, sub: u64) -> Self
pub fn with_subservice(self, sub: u64) -> Self
Creates a new ServiceId instance with the given main service ID and sub-service ID.
Sourcepub fn has_sub_id(&self) -> bool
pub fn has_sub_id(&self) -> bool
Checks if the ServiceId has a sub-service ID.
Returns true if the sub-service ID is not zero, indicating that it is a specific instance of the service.
Sourcepub const fn to_be_bytes(&self) -> [u8; 16]
pub const fn to_be_bytes(&self) -> [u8; 16]
Converts the ServiceId to a big-endian byte array.
Sourcepub const fn from_be_bytes(bytes: [u8; 16]) -> Self
pub const fn from_be_bytes(bytes: [u8; 16]) -> Self
Creates a ServiceId from a big-endian byte array.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ServiceId
impl<'de> Deserialize<'de> for ServiceId
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<S> FromRequestParts<S> for ServiceId
impl<S> FromRequestParts<S> for ServiceId
Source§impl Ord for ServiceId
impl Ord for ServiceId
Source§impl PartialOrd for ServiceId
impl PartialOrd for ServiceId
impl Copy for ServiceId
impl Eq for ServiceId
impl StructuralPartialEq for ServiceId
Auto Trait Implementations§
impl Freeze for ServiceId
impl RefUnwindSafe for ServiceId
impl Send for ServiceId
impl Sync for ServiceId
impl Unpin for ServiceId
impl UnwindSafe for ServiceId
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.