pub struct TrustDomain { /* private fields */ }
Expand description
Represents a SPIFFE Trust domain
Implementations§
Source§impl TrustDomain
impl TrustDomain
Sourcepub fn new(id_or_name: &str) -> Result<Self, SpiffeIdError>
pub fn new(id_or_name: &str) -> Result<Self, SpiffeIdError>
Attempts to parse a TrustDomain instance from the given name or spiffe_id string.
§Arguments
id_or_name
- Name of a trust domain, it also can be a SPIFFE ID string from which the domain name is extracted.
§Errors
If the function cannot parse the input as a Trust domain, a SpiffeIdError
variant will be returned.
§Examples
use spiffe::TrustDomain;
let trust_domain = TrustDomain::new("domain.test").unwrap();
assert_eq!("domain.test", trust_domain.to_string());
assert_eq!("spiffe://domain.test", trust_domain.id_string());
let trust_domain = TrustDomain::new("spiffe://example.org/path").unwrap();
assert_eq!("example.org", trust_domain.to_string());
assert_eq!("spiffe://example.org", trust_domain.id_string());
Trait Implementations§
Source§impl AsRef<str> for TrustDomain
impl AsRef<str> for TrustDomain
Source§impl Clone for TrustDomain
impl Clone for TrustDomain
Source§fn clone(&self) -> TrustDomain
fn clone(&self) -> TrustDomain
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 Debug for TrustDomain
impl Debug for TrustDomain
Source§impl Display for TrustDomain
impl Display for TrustDomain
Source§impl FromStr for TrustDomain
impl FromStr for TrustDomain
Source§impl Hash for TrustDomain
impl Hash for TrustDomain
Source§impl Ord for TrustDomain
impl Ord for TrustDomain
Source§fn cmp(&self, other: &TrustDomain) -> Ordering
fn cmp(&self, other: &TrustDomain) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TrustDomain
impl PartialEq for TrustDomain
Source§impl PartialOrd for TrustDomain
impl PartialOrd for TrustDomain
Source§impl TryFrom<&str> for TrustDomain
impl TryFrom<&str> for TrustDomain
Source§impl TryFrom<String> for TrustDomain
impl TryFrom<String> for TrustDomain
impl Eq for TrustDomain
impl StructuralPartialEq for TrustDomain
Auto Trait Implementations§
impl Freeze for TrustDomain
impl RefUnwindSafe for TrustDomain
impl Send for TrustDomain
impl Sync for TrustDomain
impl Unpin for TrustDomain
impl UnwindSafe for TrustDomain
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§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§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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request