[][src]Enum opentimestamps::attestation::Attestation

pub enum Attestation {
    Bitcoin {
        height: usize,
    },
    Pending {
        uri: String,
    },
    Unknown {
        tag: Vec<u8>,
        data: Vec<u8>,
    },
}

An attestation that some data existed at some time

Variants

Bitcoin

An attestation from a Bitcoin blockheader. This consists of a blockheight and nothing more, it is expected that the current hash is equal to the Merkle root of the block at this height.

Fields of Bitcoin

height: usize
Pending

An attestation from some server. It is commented at length in Peter Todd's python-opentimestamps that the server should be expected to keep anything it attests to, forever, and therefore the only thing we store locally is a single simple URI with a very restricted charset. (The restricted charset seems mainly to be to avoid the software being used for nefarious purposes, as it will fetch this URI under some circumstances.)

Fields of Pending

uri: String
Unknown

An unknown attestation that we just store straight

Fields of Unknown

tag: Vec<u8>data: Vec<u8>

Methods

impl Attestation[src]

pub fn deserialize<R: Read>(
    deser: &mut Deserializer<R>
) -> Result<Attestation, Error>
[src]

Deserialize an arbitrary attestation

pub fn serialize<W: Write>(&self, ser: &mut Serializer<W>) -> Result<(), Error>[src]

Serialize an attestation

Trait Implementations

impl Clone for Attestation[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Attestation> for Attestation[src]

impl Eq for Attestation[src]

impl Display for Attestation[src]

impl Debug for Attestation[src]

Auto Trait Implementations

impl Unpin for Attestation

impl Sync for Attestation

impl Send for Attestation

impl UnwindSafe for Attestation

impl RefUnwindSafe for Attestation

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]