pub enum VadePluginResultValue<T> {
    NotImplemented,
    Ignored,
    Success(T),
}
Expand description

Wrapper enum for a plugins return value

Variants§

§

NotImplemented

Plugin does not implement this function. This is returned by default as the VadePlugin trait offers a default implementation for every function (which returns NotImplemented). So if a function is not explicitly implemented by a plugin itself, a call to this function will return NotImplemented.

§

Ignored

Plugin implements function but is not “interested” in fulfilling function call. This mostly signs that the responding plugin does not resolve/handle given method, e.g. a plugin may resolve dids with prefix did:example123 and not dids with prefix did:example456.

§

Success(T)

Plugin handled request and returned a value of type T. Note that Success values can be unwrapped. So if you know, that a plugin implements a function and handles requests of your method, you can call unwrap on it to fetch the underlying value of type T.

Implementations§

source§

impl<T> VadePluginResultValue<T>

source

pub fn unwrap(self) -> T

Unwraps inner value like:

  • Success(T) unwraps successfully to T
  • NotImplemented and Ignored unwrap to errors

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for VadePluginResultValue<T>where T: RefUnwindSafe,

§

impl<T> Send for VadePluginResultValue<T>where T: Send,

§

impl<T> Sync for VadePluginResultValue<T>where T: Sync,

§

impl<T> Unpin for VadePluginResultValue<T>where T: Unpin,

§

impl<T> UnwindSafe for VadePluginResultValue<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.