pub struct ArgumentsMetadataDecoder<'a, 'metadata> { /* private fields */ }Implementations§
Source§impl<'metadata> ArgumentsMetadataDecoder<'_, 'metadata>
impl<'metadata> ArgumentsMetadataDecoder<'_, 'metadata>
Sourcepub fn without_auto_drain(self) -> ManuallyDrop<Self>
pub fn without_auto_drain(self) -> ManuallyDrop<Self>
Get a wrapped value that does not automatically drain the metadata on drop.
The default behavior is to automatically drain the metadata on drop such that
contract/trait or method metadata decoding progresses successfully, even when the caller
doesn’t care about arguments. This, however, generates more code and causes difficulties for
LLVM when it tries to optimize the code and especially when trying to prove the lack of
panics. Usually this method is not needed, but if you are having difficulties with
no-panic and either decoding a single method or drain arguments explicitly, you can use
this helper method to work around compiler limitations.
Sourcepub fn remaining_metadata_bytes(&self) -> usize
pub fn remaining_metadata_bytes(&self) -> usize
The number of bytes left in the metadata that were not processed yet
Sourcepub fn decode_next<'a>(
&'a mut self,
) -> Option<Result<ArgumentMetadataItem<'metadata>, MetadataDecodingError<'metadata>>>
pub fn decode_next<'a>( &'a mut self, ) -> Option<Result<ArgumentMetadataItem<'metadata>, MetadataDecodingError<'metadata>>>
Decode the next argument, returning None after MethodMetadataItem::num_arguments
items, errors included.
Arguments are returned in the order that #[contract] generates them in, which
ContractMetadataKind::Init describes. An argument out of that order is rejected with
MetadataDecodingError::ArgumentOutOfOrder.
Trait Implementations§
Source§impl<'a, 'metadata> Debug for ArgumentsMetadataDecoder<'a, 'metadata>
impl<'a, 'metadata> Debug for ArgumentsMetadataDecoder<'a, 'metadata>
Source§impl Drop for ArgumentsMetadataDecoder<'_, '_>
impl Drop for ArgumentsMetadataDecoder<'_, '_>
Auto Trait Implementations§
impl<'a, 'metadata> !UnwindSafe for ArgumentsMetadataDecoder<'a, 'metadata>
impl<'a, 'metadata> Freeze for ArgumentsMetadataDecoder<'a, 'metadata>
impl<'a, 'metadata> RefUnwindSafe for ArgumentsMetadataDecoder<'a, 'metadata>
impl<'a, 'metadata> Send for ArgumentsMetadataDecoder<'a, 'metadata>
impl<'a, 'metadata> Sync for ArgumentsMetadataDecoder<'a, 'metadata>
impl<'a, 'metadata> Unpin for ArgumentsMetadataDecoder<'a, 'metadata>
impl<'a, 'metadata> UnsafeUnpin for ArgumentsMetadataDecoder<'a, 'metadata>
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
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> ⓘ
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> ⓘ
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