pub struct WirePrincipal {
pub reference: String,
pub mapping_version: String,
pub scope: String,
}Expand description
An opaque principal reference on the wire (spec 020, 3.6): the host’s bytes as lowercase hexadecimal, the host’s mapping version, and the declared scope. Rustev never interprets, authenticates, authorizes or expands it.
Fields§
§reference: String§mapping_version: String§scope: StringImplementations§
Source§impl WirePrincipal
impl WirePrincipal
Sourcepub fn encode(
reference: &[u8],
mapping_version: &str,
scope: &str,
) -> Option<Self>
pub fn encode( reference: &[u8], mapping_version: &str, scope: &str, ) -> Option<Self>
Encode reference canonically. None when the reference is empty
or beyond MAX_PRINCIPAL_BYTES, or a label is empty, beyond
MAX_PRINCIPAL_LABEL_BYTES or not printable ASCII.
Sourcepub fn reference_bytes(&self) -> Option<Vec<u8>>
pub fn reference_bytes(&self) -> Option<Vec<u8>>
The reference’s bytes, when it is canonical lowercase hexadecimal.
pub fn is_canonical(&self) -> bool
Sourcepub fn evidence(&self) -> PrincipalEvidence
pub fn evidence(&self) -> PrincipalEvidence
What evidence holds instead of the reference: a domain-separated digest over the mapping version, the scope and the reference.
Trait Implementations§
Source§impl Clone for WirePrincipal
impl Clone for WirePrincipal
Source§impl Debug for WirePrincipal
impl Debug for WirePrincipal
Source§impl<'de> Deserialize<'de> for WirePrincipal
impl<'de> Deserialize<'de> for WirePrincipal
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
impl Eq for WirePrincipal
Source§impl JsonSchema for WirePrincipal
impl JsonSchema for WirePrincipal
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for WirePrincipal
impl PartialEq for WirePrincipal
Source§impl Serialize for WirePrincipal
impl Serialize for WirePrincipal
impl StructuralPartialEq for WirePrincipal
Auto Trait Implementations§
impl Freeze for WirePrincipal
impl RefUnwindSafe for WirePrincipal
impl Send for WirePrincipal
impl Sync for WirePrincipal
impl Unpin for WirePrincipal
impl UnsafeUnpin for WirePrincipal
impl UnwindSafe for WirePrincipal
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