pub struct Principal {
pub name: Vec<u8>,
pub email: Vec<u8>,
}Expand description
Human identity accountable for changes.
Fields§
§name: Vec<u8>Human-readable name bytes, preserved exactly from the source identity.
email: Vec<u8>Email address bytes, preserved exactly from the source identity.
Implementations§
Source§impl Principal
impl Principal
Sourcepub fn new(name: impl AsRef<[u8]>, email: impl AsRef<[u8]>) -> Principal
pub fn new(name: impl AsRef<[u8]>, email: impl AsRef<[u8]>) -> Principal
Create a new principal.
Sourcepub fn name_lossy(&self) -> Cow<'_, str>
pub fn name_lossy(&self) -> Cow<'_, str>
Return the name as text for display or text-only API boundaries.
Sourcepub fn email_lossy(&self) -> Cow<'_, str>
pub fn email_lossy(&self) -> Cow<'_, str>
Return the email as text for display or text-only API boundaries.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Principal
impl<'de> Deserialize<'de> for Principal
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Principal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Principal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Principal
Source§impl Serialize for Principal
impl Serialize for Principal
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Principal
Auto Trait Implementations§
impl Freeze for Principal
impl RefUnwindSafe for Principal
impl Send for Principal
impl Sync for Principal
impl Unpin for Principal
impl UnsafeUnpin for Principal
impl UnwindSafe for Principal
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