pub struct Authority { /* private fields */ }Expand description
A portable authority value: exactly the mesh Caveats lattice, given a
stable content identity for the first time. Introducing an identity, not a
new authority model — Newt has no Grant type today; authority is a bare
Caveats, so AuthorityId is the first stable name a delegated authority
ever gets.
Implementations§
Source§impl Authority
impl Authority
Sourcepub fn id(&self) -> Result<AuthorityId, ContentError>
pub fn id(&self) -> Result<AuthorityId, ContentError>
This authority’s typed content id (L1).
§Errors
Propagates a dag-cbor encoding error (e.g. a non-finite float — impossible
for Caveats, which has no floats).
Trait Implementations§
Source§impl ContentAddressable for Authority
impl ContentAddressable for Authority
Source§fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
Produce the deterministic byte representation of this value. Read more
Source§fn content_id(&self) -> Result<ContentId, ContentError>
fn content_id(&self) -> Result<ContentId, ContentError>
Source§fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
Check whether this value’s content id matches an
expected id. Read moreSource§fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
Verify, returning an error on mismatch instead of
Ok(false). Read moreSource§fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
Checked ingress: decode a value from its canonical form, proving the
bytes reproduce it — a checked partial inverse of
canonical_form. Read moreSource§impl<'de> Deserialize<'de> for Authority
impl<'de> Deserialize<'de> for Authority
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 Authority
impl StructuralPartialEq for Authority
Auto Trait Implementations§
impl Freeze for Authority
impl RefUnwindSafe for Authority
impl Send for Authority
impl Sync for Authority
impl Unpin for Authority
impl UnsafeUnpin for Authority
impl UnwindSafe for Authority
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