#[non_exhaustive]pub enum RexOutput {
Success(RexResponse),
RexError(RexError),
UnserializableResponse(String),
}Expand description
The output from REX.
This enum represents the possible outcomes of a REX execution.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Success(RexResponse)
The response of a successfully handled REX request.
RexError(RexError)
The details of an error reported by a REX execution.
UnserializableResponse(String)
The REX execution produced an unserializable response.
Implementations§
Source§impl RexOutput
impl RexOutput
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if the output is a success.
Sourcepub fn is_rex_error(&self) -> bool
pub fn is_rex_error(&self) -> bool
Returns true if the output is a REX error.
Sourcepub fn is_unserializable_response(&self) -> bool
pub fn is_unserializable_response(&self) -> bool
Returns true if the output is an unserializable response.
Sourcepub fn as_success(&self) -> Option<&RexResponse>
pub fn as_success(&self) -> Option<&RexResponse>
Returns the contained RexResponse if the output is a success, otherwise returns None.
Sourcepub fn as_rex_error(&self) -> Option<&RexError>
pub fn as_rex_error(&self) -> Option<&RexError>
Returns the contained RexError if the output is a REX error, otherwise returns None.
Trait Implementations§
Source§impl BorshDeserialize for RexOutput
impl BorshDeserialize for RexOutput
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for RexOutput
impl BorshSerialize for RexOutput
Source§impl<'de> Deserialize<'de> for RexOutput
impl<'de> Deserialize<'de> for RexOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RexOutput
Source§impl HumanReadable for RexOutput
impl HumanReadable for RexOutput
Source§fn human_readable(&self) -> String
fn human_readable(&self) -> String
Return a human-readable string representation
impl Representable for RexOutput
impl StructuralPartialEq for RexOutput
Auto Trait Implementations§
impl Freeze for RexOutput
impl RefUnwindSafe for RexOutput
impl Send for RexOutput
impl Sync for RexOutput
impl Unpin for RexOutput
impl UnsafeUnpin for RexOutput
impl UnwindSafe for RexOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.