Skip to main content

Source

Struct Source 

Source
pub struct Source { /* private fields */ }
Expand description

Where a stored receipt’s value was taken from (8.1, spec-0.6.0): the optional source member, present only on a receipt with no inputs. The signer relays the value of another party; the signature covers source, and verification does not fetch url (the trust value relayed, 5.5). Built with Source::new and the with_* methods; a receipt holding one is checked by Receipt::from_json or by ReceiptBuilder::sign (feature sign).

Implementations§

Source§

impl Source

Source

pub fn new(name: &str, url: &str, retrieved: &str) -> Source

A source with its required members: name (the source’s DNS name, 2.1), url (where the value was taken from) and retrieved (an instant, when it was fetched). Not checked here: the receipt check (10.1 step 3) and sign report what is wrong with it.

Source

pub fn with_sha256(self, sha256: &str) -> Source

With sha256: 64 lowercase hex digits, the SHA-256 of the bytes fetched from url.

Source

pub fn with_takeover(self, takeover: &str) -> Source

With takeover: an https:// URL where the source can take over publishing these cells.

Source

pub fn name(&self) -> &str

The source’s DNS name.

Source

pub fn url(&self) -> &str

Where the value was taken from.

Source

pub fn retrieved(&self) -> &str

When the publisher fetched the value.

Source

pub fn sha256(&self) -> Option<&str>

The SHA-256 of the bytes fetched from url, when given.

Source

pub fn takeover(&self) -> Option<&str>

Where the source can take over publishing these cells, when given.

Trait Implementations§

Source§

impl Clone for Source

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Source

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Source

Source§

impl Hash for Source

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Source

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Source

Auto Trait Implementations§

§

impl Forget for Source

§

impl Freeze for Source

§

impl Move for Source

§

impl RefUnwindSafe for Source

§

impl Send for Source

§

impl Sync for Source

§

impl Unpin for Source

§

impl UnsafeUnpin for Source

§

impl UnwindSafe for Source

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.