[−][src]Enum ctclient::SthResult
Either a fetched and checked SignedTreeHead
, or a SignedTreeHead
that has a valid signature
but did not pass some internal checks, or just an Error
.
Variants
Ok(SignedTreeHead)
Got the new tree head.
Err(Error)
Something went wrong and no tree head was received.
ErrWithSth(Error, SignedTreeHead)
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 an 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
Auto Trait Implementations
impl !RefUnwindSafe for SthResult
impl Send for SthResult
impl Sync for SthResult
impl Unpin for SthResult
impl !UnwindSafe for SthResult
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,