[][src]Enum ctclient::SthResult

pub enum SthResult {
    Ok(SignedTreeHead),
    Err(Error),
    ErrWithSth(ErrorSignedTreeHead),
}

Variants

Got the new tree head.

Err(Error)

Something went wrong and no tree head was received.

ErrWithSth(ErrorSignedTreeHead)

Something went wrong, but the server returned a valid signed tree head. The underlying error is wrapped inside. You may wish to log this.

Implementations

impl SthResult[src]

pub fn tree_head(&self) -> Option<&SignedTreeHead>[src]

Return a signed tree head, if there is one received.

This can return a Some even when there is error, if for example, the server returned a valid signed tree head but failed to provide a consistency proof. You may wish to log this.

pub fn is_ok(&self) -> bool[src]

pub fn is_err(&self) -> bool[src]

pub fn unwrap(self) -> SignedTreeHead[src]

Return the SignedTreeHead, if this is a Ok. Otherwise panic.

pub fn unwrap_err(self) -> Error[src]

Return the error, if this is a Err or ErrWithSth. Otherwise panic.

pub fn unwrap_tree_head(self) -> SignedTreeHead[src]

Return the SignedTreeHead, if this is a Ok or ErrWithSth. Otherwise panic.

Trait Implementations

impl Debug for SthResult[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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.