Struct soroban_env_host::events::DebugError
source · pub struct DebugError {
pub event: DebugEvent,
pub status: Status,
}
Expand description
Combines a DebugEvent with a Status that created it, typically used as a transient type when recording a (possibly enriched) debug event for a status and then converting the status to a HostError. See host::Host::err for normal use.
Examples
use soroban_env_host::{RawVal, xdr::ScHostFnErrorCode, events::DebugError};
let r: RawVal = 1i32.into();
let name: &'static str = "abc";
let de = DebugError::new(ScHostFnErrorCode::InputArgsWrongType)
.msg("unexpected RawVal {} for input '{}', need U32")
.arg(r)
.arg(name);
assert_eq!(
format!("{}", de.event),
"unexpected RawVal I32(1) for input 'abc', need U32"
);
Fields§
§event: DebugEvent
§status: Status
Implementations§
Trait Implementations§
source§impl Clone for DebugError
impl Clone for DebugError
source§fn clone(&self) -> DebugError
fn clone(&self) -> DebugError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DebugError
impl Debug for DebugError
source§impl From<Error> for DebugError
impl From<Error> for DebugError
Auto Trait Implementations§
impl RefUnwindSafe for DebugError
impl Send for DebugError
impl Sync for DebugError
impl Unpin for DebugError
impl UnwindSafe for DebugError
Blanket Implementations§
source§impl<T, U, E, C> Compare<(T, U)> for Cwhere
C: Compare<T, Error = E, Error = E> + Compare<U>,
impl<T, U, E, C> Compare<(T, U)> for Cwhere C: Compare<T, Error = E, Error = E> + Compare<U>,
source§impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.