Struct levana_perpswap_cosmos_msg::prelude::PerpError
pub struct PerpError<T = ()> {
pub id: ErrorId,
pub domain: ErrorDomain,
pub description: String,
pub data: Option<T>,
}
Expand description
An error message for the perps protocol
Fields§
§id: ErrorId
Unique identifier for this error
domain: ErrorDomain
Where in the protocol the error came from
description: String
User friendly description
data: Option<T>
Optional additional information
Implementations§
§impl PerpError
impl PerpError
pub fn mixin_event(&self, evt: Event) -> Event
pub fn mixin_event(&self, evt: Event) -> Event
Include error information into an event
pub fn unimplemented() -> PerpError
pub fn unimplemented() -> PerpError
Generate an error saying something is unimplemented
Trait Implementations§
§impl<'de, T> Deserialize<'de> for PerpError<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for PerpError<T>where T: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<PerpError<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<PerpError<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<T> Error for PerpError<T>where
T: Serialize,
impl<T> Error for PerpError<T>where T: Serialize,
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
§impl<T> JsonSchema for PerpError<T>where
T: JsonSchema,
impl<T> JsonSchema for PerpError<T>where T: JsonSchema,
§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read more§impl<T> PartialEq for PerpError<T>where
T: PartialEq,
impl<T> PartialEq for PerpError<T>where T: PartialEq,
§impl<T> Serialize for PerpError<T>where
T: Serialize,
impl<T> Serialize for PerpError<T>where T: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Eq for PerpError<T>where T: Eq,
impl<T> StructuralEq for PerpError<T>
impl<T> StructuralPartialEq for PerpError<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for PerpError<T>where T: RefUnwindSafe,
impl<T> Send for PerpError<T>where T: Send,
impl<T> Sync for PerpError<T>where T: Sync,
impl<T> Unpin for PerpError<T>where T: Unpin,
impl<T> UnwindSafe for PerpError<T>where T: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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
§impl<T> QueryResultExt for Twhere
T: Serialize,
impl<T> QueryResultExt for Twhere T: Serialize,
§fn query_result(&self) -> Result<Binary, Error>
fn query_result(&self) -> Result<Binary, Error>
Convert the value to its JSON representation