pub struct ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,{ /* private fields */ }
Expand description
Smart contract error that can concatenate multiple message pieces. The message is kept as a managed buffer in the VM.
Implementations§
Source§impl<M> ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
pub fn new_empty() -> ManagedSCError<M>
pub fn new_from_bytes(bytes: &[u8]) -> ManagedSCError<M>
pub fn append_bytes(&mut self, slice: &[u8])
pub fn exit_now(&self) -> !
Trait Implementations§
Source§impl<M> From<&[u8]> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> From<&[u8]> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§fn from(message: &[u8]) -> ManagedSCError<M>
fn from(message: &[u8]) -> ManagedSCError<M>
Converts to this type from the input type.
Source§impl<M> From<&str> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> From<&str> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§fn from(message: &str) -> ManagedSCError<M>
fn from(message: &str) -> ManagedSCError<M>
Converts to this type from the input type.
Source§impl<M> From<BoxedBytes> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> From<BoxedBytes> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§fn from(message: BoxedBytes) -> ManagedSCError<M>
fn from(message: BoxedBytes) -> ManagedSCError<M>
Converts to this type from the input type.
Source§impl<M> From<ManagedBuffer<M>> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> From<ManagedBuffer<M>> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§fn from(message: ManagedBuffer<M>) -> ManagedSCError<M>
fn from(message: ManagedBuffer<M>) -> ManagedSCError<M>
Converts to this type from the input type.
Source§impl<M> From<String> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> From<String> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§fn from(message: String) -> ManagedSCError<M>
fn from(message: String) -> ManagedSCError<M>
Converts to this type from the input type.
Source§impl<M> From<Vec<u8>> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> From<Vec<u8>> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§impl<M> SCError for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> SCError for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
fn finish_err<FA>(&self) -> !where
FA: EndpointFinishApi,
Source§impl<M> TopEncodeMulti for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> TopEncodeMulti for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
Version of
top_encode
that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
Attempt to serialize the value to ouput.
Source§impl<M> TryStaticCast for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> TryStaticCast for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
fn type_eq<U>() -> boolwhere
U: TryStaticCast,
fn try_cast<U>(self) -> Option<U>where
U: TryStaticCast,
fn try_cast_ref<U>(&self) -> Option<&U>where
U: TryStaticCast,
Auto Trait Implementations§
impl<M> Freeze for ManagedSCError<M>
impl<M> RefUnwindSafe for ManagedSCError<M>
impl<M> Send for ManagedSCError<M>
impl<M> Sync for ManagedSCError<M>
impl<M> Unpin for ManagedSCError<M>
impl<M> UnwindSafe for ManagedSCError<M>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more