pub struct Proof { /* private fields */ }Expand description
Serialized Proof (crate review or trust of someone)
A signed proof containing some signed Content
Implementations§
Source§impl Proof
impl Proof
Sourcepub fn from_parts(body: String, signature: String) -> Result<Self, Error>
pub fn from_parts(body: String, signature: String) -> Result<Self, Error>
Assumes the body has been properly signed already
Sourcepub fn from_legacy_parts(
body: String,
signature: String,
type_name: String,
) -> Result<Self, Error>
pub fn from_legacy_parts( body: String, signature: String, type_name: String, ) -> Result<Self, Error>
For back-compat, ignore it
Sourcepub fn parse_content<T: ContentDeserialize>(&self) -> Result<T, Error>
pub fn parse_content<T: ContentDeserialize>(&self) -> Result<T, Error>
Read the YAML with serde, you should already know which type to expect from context
Trait Implementations§
Source§impl CommonOps for Proof
impl CommonOps for Proof
fn common(&self) -> &Common
Source§fn date(&self) -> &DateTime<FixedOffset>
fn date(&self) -> &DateTime<FixedOffset>
When it has been written according to its creator
ID of the person who signed it
Displayable version of ID of the person who signed it
Source§fn ensure_kind_is(&self, kind: &str) -> ValidationResult<()>
fn ensure_kind_is(&self, kind: &str) -> ValidationResult<()>
Easy check of
kind()Auto Trait Implementations§
impl Freeze for Proof
impl RefUnwindSafe for Proof
impl Send for Proof
impl Sync for Proof
impl Unpin for Proof
impl UnwindSafe for Proof
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