Struct soroban_env_host::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<ConversionError> for Status
impl From<ConversionError> for Status
source§fn from(_: ConversionError) -> Status
fn from(_: ConversionError) -> Status
Converts to this type from the input type.
source§impl From<Infallible> for Status
impl From<Infallible> for Status
source§fn from(_: Infallible) -> Status
fn from(_: Infallible) -> Status
Converts to this type from the input type.
source§impl From<ScHostAuthErrorCode> for Status
impl From<ScHostAuthErrorCode> for Status
source§fn from(code: ScHostAuthErrorCode) -> Status
fn from(code: ScHostAuthErrorCode) -> Status
Converts to this type from the input type.
source§impl From<ScHostContextErrorCode> for Status
impl From<ScHostContextErrorCode> for Status
source§fn from(code: ScHostContextErrorCode) -> Status
fn from(code: ScHostContextErrorCode) -> Status
Converts to this type from the input type.
source§impl From<ScHostFnErrorCode> for Status
impl From<ScHostFnErrorCode> for Status
source§fn from(code: ScHostFnErrorCode) -> Status
fn from(code: ScHostFnErrorCode) -> Status
Converts to this type from the input type.
source§impl From<ScHostObjErrorCode> for Status
impl From<ScHostObjErrorCode> for Status
source§fn from(code: ScHostObjErrorCode) -> Status
fn from(code: ScHostObjErrorCode) -> Status
Converts to this type from the input type.
source§impl From<ScHostStorageErrorCode> for Status
impl From<ScHostStorageErrorCode> for Status
source§fn from(code: ScHostStorageErrorCode) -> Status
fn from(code: ScHostStorageErrorCode) -> Status
Converts to this type from the input type.
source§impl From<ScHostValErrorCode> for Status
impl From<ScHostValErrorCode> for Status
source§fn from(code: ScHostValErrorCode) -> Status
fn from(code: ScHostValErrorCode) -> Status
Converts to this type from the input type.
source§impl From<ScUnknownErrorCode> for Status
impl From<ScUnknownErrorCode> for Status
source§fn from(code: ScUnknownErrorCode) -> Status
fn from(code: ScUnknownErrorCode) -> Status
Converts to this type from the input type.
source§impl From<ScVmErrorCode> for Status
impl From<ScVmErrorCode> for Status
source§fn from(code: ScVmErrorCode) -> Status
fn from(code: ScVmErrorCode) -> Status
Converts to this type from the input type.
source§impl From<SymbolError> for Status
impl From<SymbolError> for Status
source§fn from(se: SymbolError) -> Status
fn from(se: SymbolError) -> Status
Converts to this type from the input type.
source§impl Ord for Status
impl Ord for Status
source§impl PartialEq<Status> for Status
impl PartialEq<Status> 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) -> Status
unsafe fn unchecked_from_val(v: RawVal) -> Status
Converts the bits making up a
Val
into Self
without checking
that the Val
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”).source§fn try_convert(v: RawVal) -> Option<Self>
fn try_convert(v: RawVal) -> Option<Self>
Attempt a conversion from
Val
to Self
, returning None
if the
provided Val
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
.source§impl<E> TryFromVal<E, RawVal> for Statuswhere
E: Env,
impl<E> TryFromVal<E, RawVal> for Statuswhere E: Env,
type Error = ConversionError
fn try_from_val( _env: &E, val: &RawVal ) -> Result<Status, <Status as TryFromVal<E, RawVal>>::Error>
source§impl<E> TryFromVal<E, Status> for RawValwhere
E: Env,
impl<E> TryFromVal<E, Status> for RawValwhere E: Env,
type Error = ConversionError
fn try_from_val( _env: &E, val: &Status ) -> Result<RawVal, <RawVal as TryFromVal<E, Status>>::Error>
impl Copy for Status
impl Eq 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§
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.