Struct soroban_env_common::Status
source · pub struct Status(_);
Expand description
Wrapper for a RawVal that is tagged with Tag::Status, interpreting the RawVal’s body as a pair of a 28-bit status-type code and a 32-bit status code. The status-type codes correspond to the enumerated cases of ScStatusType, and the status codes correspond to the code values stored in each variant of the ScStatus union.
Implementations§
source§impl Status
impl Status
pub const fn is_type(&self, ty: ScStatusType) -> bool
pub const fn get_code(&self) -> u32
pub const fn is_ok(&self) -> bool
pub const fn from_contract_error(code: u32) -> Status
pub const fn from_type_and_code(ty: ScStatusType, code: u32) -> Status
pub const fn from_status(sc: ScStatus) -> Status
Trait Implementations§
source§impl From<BitSetError> for Status
impl From<BitSetError> for Status
source§fn from(bse: BitSetError) -> Self
fn from(bse: BitSetError) -> Self
Converts to this type from the input type.
source§impl From<ConversionError> for Status
impl From<ConversionError> for Status
source§fn from(_: ConversionError) -> Self
fn from(_: ConversionError) -> Self
Converts to this type from the input type.
source§impl From<Infallible> for Status
impl From<Infallible> for Status
source§fn from(_: Infallible) -> Self
fn from(_: Infallible) -> Self
Converts to this type from the input type.
source§impl From<ScHostContextErrorCode> for Status
impl From<ScHostContextErrorCode> for Status
source§fn from(code: ScHostContextErrorCode) -> Self
fn from(code: ScHostContextErrorCode) -> Self
Converts to this type from the input type.
source§impl From<ScHostFnErrorCode> for Status
impl From<ScHostFnErrorCode> for Status
source§fn from(code: ScHostFnErrorCode) -> Self
fn from(code: ScHostFnErrorCode) -> Self
Converts to this type from the input type.
source§impl From<ScHostObjErrorCode> for Status
impl From<ScHostObjErrorCode> for Status
source§fn from(code: ScHostObjErrorCode) -> Self
fn from(code: ScHostObjErrorCode) -> Self
Converts to this type from the input type.
source§impl From<ScHostStorageErrorCode> for Status
impl From<ScHostStorageErrorCode> for Status
source§fn from(code: ScHostStorageErrorCode) -> Self
fn from(code: ScHostStorageErrorCode) -> Self
Converts to this type from the input type.
source§impl From<ScHostValErrorCode> for Status
impl From<ScHostValErrorCode> for Status
source§fn from(code: ScHostValErrorCode) -> Self
fn from(code: ScHostValErrorCode) -> Self
Converts to this type from the input type.
source§impl From<ScUnknownErrorCode> for Status
impl From<ScUnknownErrorCode> for Status
source§fn from(code: ScUnknownErrorCode) -> Self
fn from(code: ScUnknownErrorCode) -> Self
Converts to this type from the input type.
source§impl From<ScVmErrorCode> for Status
impl From<ScVmErrorCode> for Status
source§fn from(code: ScVmErrorCode) -> Self
fn from(code: ScVmErrorCode) -> Self
Converts to this type from the input type.
source§impl From<SymbolError> for Status
impl From<SymbolError> for Status
source§fn from(se: SymbolError) -> Self
fn from(se: SymbolError) -> Self
Converts to this type from the input type.
source§impl Ord for Status
impl Ord for Status
source§impl PartialOrd<Status> for Status
impl PartialOrd<Status> for Status
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl RawValConvertible for Status
impl RawValConvertible for Status
source§fn is_val_type(v: RawVal) -> bool
fn is_val_type(v: RawVal) -> bool
Returns
true
if v
is in a union state compatible with Self
.source§unsafe fn unchecked_from_val(v: RawVal) -> Self
unsafe fn unchecked_from_val(v: RawVal) -> Self
Converts the bits making up a
RawVal
into Self
without checking
that the RawVal
is tagged correctly, assuming that such a check has
been performed elsewhere. It is the caller’s responsibility to arrange
that such checks have occurred before calling unchecked_from_val
,
which is why it is marked as unsafe
(it does not represent a risk of
memory-unsafety, merely “serious logic errors”). Read moresource§fn try_convert(v: RawVal) -> Option<Self>
fn try_convert(v: RawVal) -> Option<Self>
Attempt a conversion from
RawVal
to Self
, returning None
if the
provided RawVal
is not tagged correctly. By default this calls
Self::is_val_type
and Self::unchecked_from_val
, but it can be
customized on a type-by-type basis to avoid redundant tag tests and
produce more efficient code, as it is done for Static
values like
bool
. Read moresource§impl<E: Env> TryFromVal<E, RawVal> for Status
impl<E: Env> TryFromVal<E, RawVal> for Status
type Error = ConversionError
fn try_from_val(_env: &E, val: RawVal) -> Result<Self, Self::Error>
impl Copy for Status
impl Eq for Status
impl Val for Status
Auto Trait Implementations§
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnwindSafe for Status
Blanket Implementations§
§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
. Read more§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
. Read more§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. Read more§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. Read more