diff --git a/pr-4404/gear_core/env/trait.Externalities.html b/pr-4404/gear_core/env/trait.Externalities.html index 9623da6da41..968ea93b211 100644 --- a/pr-4404/gear_core/env/trait.Externalities.html +++ b/pr-4404/gear_core/env/trait.Externalities.html @@ -66,7 +66,7 @@ ) -> Result<(), Self::FallibleError>; fn source(&self) -> Result<ProgramId, Self::UnrecoverableError>; fn reply_code(&self) -> Result<ReplyCode, Self::FallibleError>; - fn signal_code(&self) -> Result<SignalCode, Self::FallibleError>; + fn signal_code(&self) -> Result<SignalCode, Self::FallibleError>; fn message_id(&self) -> Result<MessageId, Self::UnrecoverableError>; fn program_id(&self) -> Result<ProgramId, Self::UnrecoverableError>; fn debug(&self, data: &str) -> Result<(), Self::UnrecoverableError>; @@ -211,7 +211,7 @@ ) -> Result<(), Self::FallibleError>

Push the incoming message buffer into reply message.

Source

fn source(&self) -> Result<ProgramId, Self::UnrecoverableError>

Get the source of the message currently being handled.

Source

fn reply_code(&self) -> Result<ReplyCode, Self::FallibleError>

Get the reply code if the message being processed.

-
Source

fn signal_code(&self) -> Result<SignalCode, Self::FallibleError>

Get the signal code if the message being processed.

+
Source

fn signal_code(&self) -> Result<SignalCode, Self::FallibleError>

Get the signal code if the message being processed.

Source

fn message_id(&self) -> Result<MessageId, Self::UnrecoverableError>

Get the id of the message currently being handled.

Source

fn program_id(&self) -> Result<ProgramId, Self::UnrecoverableError>

Get the id of program itself

Source

fn debug(&self, data: &str) -> Result<(), Self::UnrecoverableError>

Send debug message.

diff --git a/pr-4404/gear_core/message/enum.ErrorReplyReason.html b/pr-4404/gear_core/message/enum.ErrorReplyReason.html index 00d462ae8b4..d83ccc0b67c 100644 --- a/pr-4404/gear_core/message/enum.ErrorReplyReason.html +++ b/pr-4404/gear_core/message/enum.ErrorReplyReason.html @@ -1,6 +1,6 @@ -ErrorReplyReason in gear_core::message - Rust
gear_core::message

Enum ErrorReplyReason

#[repr(u8)]
pub enum ErrorReplyReason { - Execution(SimpleExecutionError), - FailedToCreateProgram(SimpleProgramCreationError), +ErrorReplyReason in gear_core::message - Rust
gear_core::message

Enum ErrorReplyReason

Source
#[repr(u8)]
pub enum ErrorReplyReason { + Execution(SimpleExecutionError), + FailedToCreateProgram(SimpleProgramCreationError), InactiveActor = 2, RemovedFromWaitlist = 3, ReinstrumentationFailure = 4, @@ -8,14 +8,14 @@ }
Expand description

Reason of error reply creation.

NOTE: Adding new variants to this enum you must also update ErrorReplyReason::to_bytes and ErrorReplyReason::from_bytes methods.

-

Variants§

§

Execution(SimpleExecutionError)

Error reply was created due to underlying execution error.

-
§

FailedToCreateProgram(SimpleProgramCreationError)

Error reply was created due to errors in program creation.

+

Variants§

§

Execution(SimpleExecutionError)

Error reply was created due to underlying execution error.

+
§

FailedToCreateProgram(SimpleProgramCreationError)

Error reply was created due to errors in program creation.

§

InactiveActor = 2

Destination actor is inactive, so it can’t process the message.

§

RemovedFromWaitlist = 3

Message has died in Waitlist as out of rent one.

§

ReinstrumentationFailure = 4

Program re-instrumentation failed.

§

Unsupported = 255

Unsupported reason of error reply. Variant exists for backward compatibility.

-

Trait Implementations§

§

impl Clone for ErrorReplyReason

§

fn clone(&self) -> ErrorReplyReason

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ErrorReplyReason

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for ErrorReplyReason

§

fn decode<__CodecInputEdqy>( +

Trait Implementations§

Source§

impl Clone for ErrorReplyReason

Source§

fn clone(&self) -> ErrorReplyReason

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ErrorReplyReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Decode for ErrorReplyReason

Source§

fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<ErrorReplyReason, Error>
where __CodecInputEdqy: Input,

Attempt to deserialise the value from input.
§

fn decode_into<I>( @@ -23,32 +23,32 @@ dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where - I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
§

impl Default for ErrorReplyReason

§

fn default() -> ErrorReplyReason

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for ErrorReplyReason

§

fn deserialize<__D>( + I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl Default for ErrorReplyReason

Source§

fn default() -> ErrorReplyReason

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ErrorReplyReason

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ErrorReplyReason, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for ErrorReplyReason

§

fn fmt( + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ErrorReplyReason

Source§

fn fmt( &self, _derive_more_display_formatter: &mut Formatter<'_>, -) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Encode for ErrorReplyReason

§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<__CodecOutputEdqy>( +) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Encode for ErrorReplyReason

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where - F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
§

impl From<ErrorReplyReason> for ReplyCode

§

fn from(original: ErrorReplyReason) -> ReplyCode

Converts to this type from the input type.
§

impl From<SimpleExecutionError> for ErrorReplyReason

§

fn from(original: SimpleExecutionError) -> ErrorReplyReason

Converts to this type from the input type.
§

impl From<SimpleProgramCreationError> for ErrorReplyReason

§

fn from(original: SimpleProgramCreationError) -> ErrorReplyReason

Converts to this type from the input type.
§

impl Hash for ErrorReplyReason

§

fn hash<__H>(&self, state: &mut __H)
where + F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl From<ErrorReplyReason> for ReplyCode

Source§

fn from(original: ErrorReplyReason) -> ReplyCode

Converts to this type from the input type.
Source§

impl From<SimpleExecutionError> for ErrorReplyReason

Source§

fn from(original: SimpleExecutionError) -> ErrorReplyReason

Converts to this type from the input type.
Source§

impl From<SimpleProgramCreationError> for ErrorReplyReason

Source§

fn from(original: SimpleProgramCreationError) -> ErrorReplyReason

Converts to this type from the input type.
Source§

impl Hash for ErrorReplyReason

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for ErrorReplyReason

§

fn cmp(&self, other: &ErrorReplyReason) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ErrorReplyReason

Source§

fn cmp(&self, other: &ErrorReplyReason) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for ErrorReplyReason

§

fn eq(&self, other: &ErrorReplyReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
§

impl PartialOrd for ErrorReplyReason

§

fn partial_cmp(&self, other: &ErrorReplyReason) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the + Self: Sized,
Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ErrorReplyReason

Source§

fn eq(&self, other: &ErrorReplyReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl PartialOrd for ErrorReplyReason

Source§

fn partial_cmp(&self, other: &ErrorReplyReason) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by -the >= operator. Read more
§

impl Sequence for ErrorReplyReason

§

const CARDINALITY: usize = 13usize

Number of values of type Self. Read more
§

fn next(&self) -> Option<ErrorReplyReason>

Returns value following *self or None if this was the end. Read more
§

fn previous(&self) -> Option<ErrorReplyReason>

Returns value preceding *self or None if this was the beginning. Read more
§

fn first() -> Option<ErrorReplyReason>

Returns the first value of type Self. Read more
§

fn last() -> Option<ErrorReplyReason>

Returns the last value of type Self. Read more
§

impl Serialize for ErrorReplyReason

§

fn serialize<__S>( +the >= operator. Read more

Source§

impl Sequence for ErrorReplyReason

Source§

const CARDINALITY: usize = 13usize

Number of values of type Self. Read more
Source§

fn next(&self) -> Option<ErrorReplyReason>

Returns value following *self or None if this was the end. Read more
Source§

fn previous(&self) -> Option<ErrorReplyReason>

Returns value preceding *self or None if this was the beginning. Read more
Source§

fn first() -> Option<ErrorReplyReason>

Returns the first value of type Self. Read more
Source§

fn last() -> Option<ErrorReplyReason>

Returns the last value of type Self. Read more
Source§

impl Serialize for ErrorReplyReason

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl TypeInfo for ErrorReplyReason

§

type Identity = ErrorReplyReason

The type identifying for which type info is provided. Read more
§

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl Copy for ErrorReplyReason

§

impl EncodeLike for ErrorReplyReason

§

impl Eq for ErrorReplyReason

§

impl StructuralPartialEq for ErrorReplyReason

Auto Trait Implementations§

§

impl Freeze for ErrorReplyReason

§

impl RefUnwindSafe for ErrorReplyReason

§

impl Send for ErrorReplyReason

§

impl Sync for ErrorReplyReason

§

impl Unpin for ErrorReplyReason

§

impl UnwindSafe for ErrorReplyReason

Blanket Implementations§

Source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TypeInfo for ErrorReplyReason

Source§

type Identity = ErrorReplyReason

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl Copy for ErrorReplyReason

Source§

impl EncodeLike for ErrorReplyReason

Source§

impl Eq for ErrorReplyReason

Source§

impl StructuralPartialEq for ErrorReplyReason

Auto Trait Implementations§

§

impl Freeze for ErrorReplyReason

§

impl RefUnwindSafe for ErrorReplyReason

§

impl Send for ErrorReplyReason

§

impl Sync for ErrorReplyReason

§

impl Unpin for ErrorReplyReason

§

impl UnwindSafe for ErrorReplyReason

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where diff --git a/pr-4404/gear_core/message/enum.ReplyCode.html b/pr-4404/gear_core/message/enum.ReplyCode.html index 0f74182a517..ba1be0348de 100644 --- a/pr-4404/gear_core/message/enum.ReplyCode.html +++ b/pr-4404/gear_core/message/enum.ReplyCode.html @@ -1,4 +1,4 @@ -ReplyCode in gear_core::message - Rust
gear_core::message

Enum ReplyCode

#[repr(u8)]
pub enum ReplyCode { +ReplyCode in gear_core::message - Rust
gear_core::message

Enum ReplyCode

Source
#[repr(u8)]
pub enum ReplyCode { Success(SuccessReplyReason), Error(ErrorReplyReason), Unsupported = 255, @@ -7,13 +7,13 @@
§

Error(ErrorReplyReason)

Error reply.

§

Unsupported = 255

Unsupported code. Variant exists for backward compatibility.

-

Implementations§

§

impl ReplyCode

pub fn to_bytes(self) -> [u8; 4]

Converts ReplyCode to 4 bytes array.

-

pub fn from_bytes(bytes: [u8; 4]) -> ReplyCode

Parses 4 bytes array to ReplyCode.

-

pub fn error(reason: impl Into<ErrorReplyReason>) -> ReplyCode

Constructs ReplyCode::Error(_) variant from underlying reason.

-

pub fn is_success(&self) -> bool

Returns bool, defining if ReplyCode represents success reply.

-

pub fn is_error(&self) -> bool

Returns bool, defining if ReplyCode represents error reply.

-

pub fn is_unsupported(&self) -> bool

Returns bool, defining if ReplyCode represents unsupported reason.

-

Trait Implementations§

§

impl Clone for ReplyCode

§

fn clone(&self) -> ReplyCode

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ReplyCode

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for ReplyCode

§

fn decode<__CodecInputEdqy>( +

Implementations§

Source§

impl ReplyCode

Source

pub fn to_bytes(self) -> [u8; 4]

Converts ReplyCode to 4 bytes array.

+
Source

pub fn from_bytes(bytes: [u8; 4]) -> ReplyCode

Parses 4 bytes array to ReplyCode.

+
Source

pub fn error(reason: impl Into<ErrorReplyReason>) -> ReplyCode

Constructs ReplyCode::Error(_) variant from underlying reason.

+
Source

pub fn is_success(&self) -> bool

Returns bool, defining if ReplyCode represents success reply.

+
Source

pub fn is_error(&self) -> bool

Returns bool, defining if ReplyCode represents error reply.

+
Source

pub fn is_unsupported(&self) -> bool

Returns bool, defining if ReplyCode represents unsupported reason.

+

Trait Implementations§

Source§

impl Clone for ReplyCode

Source§

fn clone(&self) -> ReplyCode

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReplyCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Decode for ReplyCode

Source§

fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<ReplyCode, Error>
where __CodecInputEdqy: Input,

Attempt to deserialise the value from input.
§

fn decode_into<I>( @@ -21,32 +21,32 @@ dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where - I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
§

impl Default for ReplyCode

§

fn default() -> ReplyCode

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for ReplyCode

§

fn deserialize<__D>( + I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl Default for ReplyCode

Source§

fn default() -> ReplyCode

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ReplyCode

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ReplyCode, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for ReplyCode

§

fn fmt( + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ReplyCode

Source§

fn fmt( &self, _derive_more_display_formatter: &mut Formatter<'_>, -) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Encode for ReplyCode

§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<__CodecOutputEdqy>( +) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Encode for ReplyCode

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where - F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
§

impl From<()> for ReplyCode

§

fn from(original: ()) -> ReplyCode

Converts to this type from the input type.
§

impl From<ErrorReplyReason> for ReplyCode

§

fn from(original: ErrorReplyReason) -> ReplyCode

Converts to this type from the input type.
§

impl From<SuccessReplyReason> for ReplyCode

§

fn from(original: SuccessReplyReason) -> ReplyCode

Converts to this type from the input type.
§

impl Hash for ReplyCode

§

fn hash<__H>(&self, state: &mut __H)
where + F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl From<()> for ReplyCode

Source§

fn from(original: ()) -> ReplyCode

Converts to this type from the input type.
Source§

impl From<ErrorReplyReason> for ReplyCode

Source§

fn from(original: ErrorReplyReason) -> ReplyCode

Converts to this type from the input type.
Source§

impl From<SuccessReplyReason> for ReplyCode

Source§

fn from(original: SuccessReplyReason) -> ReplyCode

Converts to this type from the input type.
Source§

impl Hash for ReplyCode

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for ReplyCode

§

fn cmp(&self, other: &ReplyCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ReplyCode

Source§

fn cmp(&self, other: &ReplyCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for ReplyCode

§

fn eq(&self, other: &ReplyCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
§

impl PartialOrd for ReplyCode

§

fn partial_cmp(&self, other: &ReplyCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the + Self: Sized,
Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ReplyCode

Source§

fn eq(&self, other: &ReplyCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl PartialOrd for ReplyCode

Source§

fn partial_cmp(&self, other: &ReplyCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by -the >= operator. Read more
§

impl Sequence for ReplyCode

§

const CARDINALITY: usize = 17usize

Number of values of type Self. Read more
§

fn next(&self) -> Option<ReplyCode>

Returns value following *self or None if this was the end. Read more
§

fn previous(&self) -> Option<ReplyCode>

Returns value preceding *self or None if this was the beginning. Read more
§

fn first() -> Option<ReplyCode>

Returns the first value of type Self. Read more
§

fn last() -> Option<ReplyCode>

Returns the last value of type Self. Read more
§

impl Serialize for ReplyCode

§

fn serialize<__S>( +the >= operator. Read more

Source§

impl Sequence for ReplyCode

Source§

const CARDINALITY: usize = 17usize

Number of values of type Self. Read more
Source§

fn next(&self) -> Option<ReplyCode>

Returns value following *self or None if this was the end. Read more
Source§

fn previous(&self) -> Option<ReplyCode>

Returns value preceding *self or None if this was the beginning. Read more
Source§

fn first() -> Option<ReplyCode>

Returns the first value of type Self. Read more
Source§

fn last() -> Option<ReplyCode>

Returns the last value of type Self. Read more
Source§

impl Serialize for ReplyCode

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl TypeInfo for ReplyCode

§

type Identity = ReplyCode

The type identifying for which type info is provided. Read more
§

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl Copy for ReplyCode

§

impl EncodeLike for ReplyCode

§

impl Eq for ReplyCode

§

impl StructuralPartialEq for ReplyCode

Auto Trait Implementations§

§

impl Freeze for ReplyCode

§

impl RefUnwindSafe for ReplyCode

§

impl Send for ReplyCode

§

impl Sync for ReplyCode

§

impl Unpin for ReplyCode

§

impl UnwindSafe for ReplyCode

Blanket Implementations§

Source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TypeInfo for ReplyCode

Source§

type Identity = ReplyCode

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl Copy for ReplyCode

Source§

impl EncodeLike for ReplyCode

Source§

impl Eq for ReplyCode

Source§

impl StructuralPartialEq for ReplyCode

Auto Trait Implementations§

§

impl Freeze for ReplyCode

§

impl RefUnwindSafe for ReplyCode

§

impl Send for ReplyCode

§

impl Sync for ReplyCode

§

impl Unpin for ReplyCode

§

impl UnwindSafe for ReplyCode

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where diff --git a/pr-4404/gear_core/message/enum.SuccessReplyReason.html b/pr-4404/gear_core/message/enum.SuccessReplyReason.html index b86ffe59014..177bbd4e566 100644 --- a/pr-4404/gear_core/message/enum.SuccessReplyReason.html +++ b/pr-4404/gear_core/message/enum.SuccessReplyReason.html @@ -1,4 +1,4 @@ -SuccessReplyReason in gear_core::message - Rust
gear_core::message

Enum SuccessReplyReason

#[repr(u8)]
pub enum SuccessReplyReason { +SuccessReplyReason in gear_core::message - Rust
gear_core::message

Enum SuccessReplyReason

Source
#[repr(u8)]
pub enum SuccessReplyReason { Auto = 0, Manual = 1, Unsupported = 255, @@ -7,7 +7,7 @@
§

Manual = 1

Success reply was created by actor manually.

§

Unsupported = 255

Unsupported reason of success reply. Variant exists for backward compatibility.

-

Trait Implementations§

§

impl Clone for SuccessReplyReason

§

fn clone(&self) -> SuccessReplyReason

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SuccessReplyReason

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for SuccessReplyReason

§

fn decode<__CodecInputEdqy>( +

Trait Implementations§

Source§

impl Clone for SuccessReplyReason

Source§

fn clone(&self) -> SuccessReplyReason

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SuccessReplyReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Decode for SuccessReplyReason

Source§

fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<SuccessReplyReason, Error>
where __CodecInputEdqy: Input,

Attempt to deserialise the value from input.
§

fn decode_into<I>( @@ -15,32 +15,32 @@ dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where - I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
§

impl Default for SuccessReplyReason

§

fn default() -> SuccessReplyReason

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for SuccessReplyReason

§

fn deserialize<__D>( + I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl Default for SuccessReplyReason

Source§

fn default() -> SuccessReplyReason

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SuccessReplyReason

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SuccessReplyReason, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for SuccessReplyReason

§

fn fmt( + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for SuccessReplyReason

Source§

fn fmt( &self, _derive_more_display_formatter: &mut Formatter<'_>, -) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Encode for SuccessReplyReason

§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<__CodecOutputEdqy>( +) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Encode for SuccessReplyReason

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
where __CodecOutputEdqy: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where - F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
§

impl From<SuccessReplyReason> for ReplyCode

§

fn from(original: SuccessReplyReason) -> ReplyCode

Converts to this type from the input type.
§

impl Hash for SuccessReplyReason

§

fn hash<__H>(&self, state: &mut __H)
where + F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl From<SuccessReplyReason> for ReplyCode

Source§

fn from(original: SuccessReplyReason) -> ReplyCode

Converts to this type from the input type.
Source§

impl Hash for SuccessReplyReason

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for SuccessReplyReason

§

fn cmp(&self, other: &SuccessReplyReason) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for SuccessReplyReason

Source§

fn cmp(&self, other: &SuccessReplyReason) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for SuccessReplyReason

§

fn eq(&self, other: &SuccessReplyReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
§

impl PartialOrd for SuccessReplyReason

§

fn partial_cmp(&self, other: &SuccessReplyReason) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the + Self: Sized,
Restrict a value to a certain interval. Read more
Source§

impl PartialEq for SuccessReplyReason

Source§

fn eq(&self, other: &SuccessReplyReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl PartialOrd for SuccessReplyReason

Source§

fn partial_cmp(&self, other: &SuccessReplyReason) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by -the >= operator. Read more
§

impl Sequence for SuccessReplyReason

§

const CARDINALITY: usize = 3usize

Number of values of type Self. Read more
§

fn next(&self) -> Option<SuccessReplyReason>

Returns value following *self or None if this was the end. Read more
§

fn previous(&self) -> Option<SuccessReplyReason>

Returns value preceding *self or None if this was the beginning. Read more
§

fn first() -> Option<SuccessReplyReason>

Returns the first value of type Self. Read more
§

fn last() -> Option<SuccessReplyReason>

Returns the last value of type Self. Read more
§

impl Serialize for SuccessReplyReason

§

fn serialize<__S>( +the >= operator. Read more

Source§

impl Sequence for SuccessReplyReason

Source§

const CARDINALITY: usize = 3usize

Number of values of type Self. Read more
Source§

fn next(&self) -> Option<SuccessReplyReason>

Returns value following *self or None if this was the end. Read more
Source§

fn previous(&self) -> Option<SuccessReplyReason>

Returns value preceding *self or None if this was the beginning. Read more
Source§

fn first() -> Option<SuccessReplyReason>

Returns the first value of type Self. Read more
Source§

fn last() -> Option<SuccessReplyReason>

Returns the last value of type Self. Read more
Source§

impl Serialize for SuccessReplyReason

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl TypeInfo for SuccessReplyReason

§

type Identity = SuccessReplyReason

The type identifying for which type info is provided. Read more
§

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl Copy for SuccessReplyReason

§

impl EncodeLike for SuccessReplyReason

§

impl Eq for SuccessReplyReason

§

impl StructuralPartialEq for SuccessReplyReason

Auto Trait Implementations§

§

impl Freeze for SuccessReplyReason

§

impl RefUnwindSafe for SuccessReplyReason

§

impl Send for SuccessReplyReason

§

impl Sync for SuccessReplyReason

§

impl Unpin for SuccessReplyReason

§

impl UnwindSafe for SuccessReplyReason

Blanket Implementations§

Source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TypeInfo for SuccessReplyReason

Source§

type Identity = SuccessReplyReason

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl Copy for SuccessReplyReason

Source§

impl EncodeLike for SuccessReplyReason

Source§

impl Eq for SuccessReplyReason

Source§

impl StructuralPartialEq for SuccessReplyReason

Auto Trait Implementations§

§

impl Freeze for SuccessReplyReason

§

impl RefUnwindSafe for SuccessReplyReason

§

impl Send for SuccessReplyReason

§

impl Sync for SuccessReplyReason

§

impl Unpin for SuccessReplyReason

§

impl UnwindSafe for SuccessReplyReason

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where diff --git a/pr-4404/gear_core/message/struct.MessageContext.html b/pr-4404/gear_core/message/struct.MessageContext.html index 0c5d3525dd8..40c735e07b9 100644 --- a/pr-4404/gear_core/message/struct.MessageContext.html +++ b/pr-4404/gear_core/message/struct.MessageContext.html @@ -11,7 +11,7 @@ &mut self, packet: InitPacket, delay: u32, -) -> Result<(MessageId, ProgramId), Error>

Send a new program initialization message.

+) -> Result<(MessageId, ProgramId), Error>

Send a new program initialization message.

Generates a new message from provided data packet. Returns message id and generated program id.

Source

pub fn send_commit( @@ -20,22 +20,22 @@ packet: HandlePacket, delay: u32, reservation: Option<ReservationId>, -) -> Result<MessageId, Error>

Send a new program initialization message.

+) -> Result<MessageId, Error>

Send a new program initialization message.

Generates message from provided data packet and stored by handle payload. Returns message id.

-
Source

pub fn send_init(&mut self) -> Result<u32, Error>

Provide space for storing payload for future message creation.

+
Source

pub fn send_init(&mut self) -> Result<u32, Error>

Provide space for storing payload for future message creation.

Returns it’s handle.

-
Source

pub fn send_push(&mut self, handle: u32, buffer: &[u8]) -> Result<(), Error>

Pushes payload into stored payload by handle.

+
Source

pub fn send_push(&mut self, handle: u32, buffer: &[u8]) -> Result<(), Error>

Pushes payload into stored payload by handle.

Source

pub fn send_push_input( &mut self, handle: u32, range: CheckedRange, -) -> Result<(), Error>

Pushes the incoming buffer/payload into stored payload by handle.

+) -> Result<(), Error>

Pushes the incoming buffer/payload into stored payload by handle.

Source

pub fn check_input_range( &self, offset: u32, len: u32, -) -> Result<CheckedRange, Error>

Check if provided offset/len are correct for the current payload +) -> Result<CheckedRange, Error>

Check if provided offset/len are correct for the current payload limits. Result CheckedRange instance is accepted by send_push_input/reply_push_input and has the method len allowing to charge gas before the calls.

@@ -43,18 +43,18 @@ &mut self, packet: ReplyPacket, reservation: Option<ReservationId>, -) -> Result<MessageId, ExtError>

Send reply message.

+) -> Result<MessageId, ExtError>

Send reply message.

Generates reply from provided data packet and stored reply payload. Returns message id.

-
Source

pub fn reply_push(&mut self, buffer: &[u8]) -> Result<(), ExtError>

Pushes payload into stored reply payload.

+
Source

pub fn reply_push(&mut self, buffer: &[u8]) -> Result<(), ExtError>

Pushes payload into stored reply payload.

Source

pub fn reply_destination(&self) -> ProgramId

Return reply destination.

-
Source

pub fn reply_push_input(&mut self, range: CheckedRange) -> Result<(), ExtError>

Pushes the incoming message buffer into stored reply payload.

-
Source

pub fn wake(&mut self, waker_id: MessageId, delay: u32) -> Result<(), Error>

Wake message by it’s message id.

+
Source

pub fn reply_push_input(&mut self, range: CheckedRange) -> Result<(), ExtError>

Pushes the incoming message buffer into stored reply payload.

+
Source

pub fn wake(&mut self, waker_id: MessageId, delay: u32) -> Result<(), Error>

Wake message by it’s message id.

Source

pub fn reply_deposit( &mut self, message_id: MessageId, amount: u64, -) -> Result<(), MessageError>

Create deposit to handle future reply on message id was sent.

+) -> Result<(), MessageError>

Create deposit to handle future reply on message id was sent.

Source

pub fn current(&self) -> &IncomingMessage

Current processing incoming message.

Source

pub fn payload_mut(&mut self) -> &mut Payload

Mutable reference to currently processed incoming message.

Source

pub fn program_id(&self) -> ProgramId

Current program’s id.

diff --git a/pr-4404/gear_core/message/struct.SignalDetails.html b/pr-4404/gear_core/message/struct.SignalDetails.html index 5e8e2ee1101..ea79a1b8777 100644 --- a/pr-4404/gear_core/message/struct.SignalDetails.html +++ b/pr-4404/gear_core/message/struct.SignalDetails.html @@ -1,8 +1,8 @@ SignalDetails in gear_core::message - Rust
gear_core::message

Struct SignalDetails

Source
pub struct SignalDetails { /* private fields */ }
Expand description

Signal details data.

-

Implementations§

Source§

impl SignalDetails

Source

pub fn new(to: MessageId, code: SignalCode) -> Self

Constructor for details.

+

Implementations§

Source§

impl SignalDetails

Source

pub fn new(to: MessageId, code: SignalCode) -> Self

Constructor for details.

Source

pub fn to_message_id(&self) -> MessageId

Returns message id signal sent from.

-
Source

pub fn to_signal_code(&self) -> SignalCode

Returns signal code of signal details.

-
Source

pub fn into_parts(self) -> (MessageId, SignalCode)

Destructs details into parts.

+
Source

pub fn to_signal_code(&self) -> SignalCode

Returns signal code of signal details.

+
Source

pub fn into_parts(self) -> (MessageId, SignalCode)

Destructs details into parts.

Trait Implementations§

Source§

impl Clone for SignalDetails

Source§

fn clone(&self) -> SignalDetails

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SignalDetails

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decode for SignalDetails

Source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>

Attempt to deserialise the value from input.
§

fn decode_into<I>( diff --git a/pr-4404/gear_core/message/struct.SignalMessage.html b/pr-4404/gear_core/message/struct.SignalMessage.html index c79adaa8f21..5ced6a2e40f 100644 --- a/pr-4404/gear_core/message/struct.SignalMessage.html +++ b/pr-4404/gear_core/message/struct.SignalMessage.html @@ -1,5 +1,5 @@ SignalMessage in gear_core::message - Rust
gear_core::message

Struct SignalMessage

Source
pub struct SignalMessage { /* private fields */ }
Expand description

Message for signal entry point.

-

Implementations§

Source§

impl SignalMessage

Source

pub fn new(origin_msg_id: MessageId, code: SignalCode) -> Self

Creates a new SignalMessage.

+

Implementations§

Source§

impl SignalMessage

Source

pub fn new(origin_msg_id: MessageId, code: SignalCode) -> Self

Creates a new SignalMessage.

Source

pub fn into_message( self, origin_msg_id: MessageId, @@ -11,7 +11,7 @@ destination: ProgramId, ) -> Dispatch

Convert SignalMessage into Dispatch.

Source

pub fn id(&self) -> MessageId

Message id.

-
Source

pub fn code(&self) -> SignalCode

Status code of the reply message.

+
Source

pub fn code(&self) -> SignalCode

Status code of the reply message.

Trait Implementations§

Source§

impl Clone for SignalMessage

Source§

fn clone(&self) -> SignalMessage

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SignalMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decode for SignalMessage

Source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>

Attempt to deserialise the value from input.
§

fn decode_into<I>( diff --git a/pr-4404/gear_core/reservation/struct.GasReserver.html b/pr-4404/gear_core/reservation/struct.GasReserver.html index 52ea9bcc155..241d51135cf 100644 --- a/pr-4404/gear_core/reservation/struct.GasReserver.html +++ b/pr-4404/gear_core/reservation/struct.GasReserver.html @@ -13,27 +13,27 @@ &mut self, amount: u64, duration: u32, -) -> Result<ReservationId, ReservationError>

Reserves gas.

+) -> Result<ReservationId, ReservationError>

Reserves gas.

Creates a new reservation and returns its id.

Returns an error if maximum limit of reservations is reached.

Source

pub fn unreserve( &mut self, id: ReservationId, -) -> Result<(u64, Option<UnreservedReimbursement>), ReservationError>

Unreserves gas reserved within id reservation.

+) -> Result<(u64, Option<UnreservedReimbursement>), ReservationError>

Unreserves gas reserved within id reservation.

Return error if:

  1. Reservation doesn’t exist.
  2. Reservation was “unreserved”, so in GasReservationState::Removed state.
  3. Reservation was marked used.
-
Source

pub fn mark_used(&mut self, id: ReservationId) -> Result<(), ReservationError>

Marks reservation as used.

+
Source

pub fn mark_used(&mut self, id: ReservationId) -> Result<(), ReservationError>

Marks reservation as used.

This allows to avoid double usage of the reservation for sending a new message from execution of message_id of current gas reserver.

Source

pub fn check_not_used( &mut self, id: ReservationId, -) -> Result<&mut bool, ReservationError>

Check if reservation is not used.

+) -> Result<&mut bool, ReservationError>

Check if reservation is not used.

If reservation does not exist returns InvalidReservationId error.

Source

pub fn nonce(&self) -> ReservationNonce

Returns gas reservations current nonce.

Source

pub fn states(&self) -> &GasReservationStates

Gets gas reservations states.

diff --git a/pr-4404/src/gear_core/env.rs.html b/pr-4404/src/gear_core/env.rs.html index 28c60627d53..9eb4edd3576 100644 --- a/pr-4404/src/gear_core/env.rs.html +++ b/pr-4404/src/gear_core/env.rs.html @@ -421,7 +421,7 @@ }; use alloc::collections::BTreeSet; use core::{fmt::Display, mem}; -use gear_core_errors::{ReplyCode, SignalCode}; +use gear_core_errors::{ReplyCode, SignalCode}; use gear_wasm_instrument::syscalls::SyscallName; /// Lock for the payload of the incoming/currently executing message. @@ -694,7 +694,7 @@ fn reply_code(&self) -> Result<ReplyCode, Self::FallibleError>; /// Get the signal code if the message being processed. - fn signal_code(&self) -> Result<SignalCode, Self::FallibleError>; + fn signal_code(&self) -> Result<SignalCode, Self::FallibleError>; /// Get the id of the message currently being handled. fn message_id(&self) -> Result<MessageId, Self::UnrecoverableError>; diff --git a/pr-4404/src/gear_core/message/common.rs.html b/pr-4404/src/gear_core/message/common.rs.html index 13e0a001659..b2a09ae073a 100644 --- a/pr-4404/src/gear_core/message/common.rs.html +++ b/pr-4404/src/gear_core/message/common.rs.html @@ -385,7 +385,7 @@ }, }; use core::ops::Deref; -use gear_core_errors::{ReplyCode, SignalCode}; +use gear_core_errors::{ReplyCode, SignalCode}; use scale_info::{ scale::{Decode, Encode}, TypeInfo, @@ -552,7 +552,7 @@ /// Returns bool defining if message is error reply. pub fn is_error_reply(&self) -> bool { self.to_reply_details() - .map(|d| d.code.is_error()) + .map(|d| d.code.is_error()) .unwrap_or(false) } @@ -629,12 +629,12 @@ /// Message id, which issues signal. to: MessageId, /// Signal code. - code: SignalCode, + code: SignalCode, } impl SignalDetails { /// Constructor for details. - pub fn new(to: MessageId, code: SignalCode) -> Self { + pub fn new(to: MessageId, code: SignalCode) -> Self { Self { to, code } } @@ -644,12 +644,12 @@ } /// Returns signal code of signal details. - pub fn to_signal_code(&self) -> SignalCode { + pub fn to_signal_code(&self) -> SignalCode { self.code } /// Destructs details into parts. - pub fn into_parts(self) -> (MessageId, SignalCode) { + pub fn into_parts(self) -> (MessageId, SignalCode) { (self.to, self.code) } } diff --git a/pr-4404/src/gear_core/message/context.rs.html b/pr-4404/src/gear_core/message/context.rs.html index f405f586d46..4423943301f 100644 --- a/pr-4404/src/gear_core/message/context.rs.html +++ b/pr-4404/src/gear_core/message/context.rs.html @@ -1188,7 +1188,7 @@ collections::{BTreeMap, BTreeSet}, vec::Vec, }; -use gear_core_errors::{ExecutionError, ExtError, MessageError as Error, MessageError}; +use gear_core_errors::{ExecutionError, ExtError, MessageError as Error, MessageError}; use scale_info::{ scale::{Decode, Encode}, TypeInfo, @@ -1404,9 +1404,9 @@ &self.settings } - fn check_reply_availability(&self) -> Result<(), ExecutionError> { + fn check_reply_availability(&self) -> Result<(), ExecutionError> { if !matches!(self.kind, DispatchKind::Init | DispatchKind::Handle) { - return Err(ExecutionError::IncorrectEntryForReply); + return Err(ExecutionError::IncorrectEntryForReply); } Ok(()) @@ -1432,17 +1432,17 @@ &mut self, packet: InitPacket, delay: u32, - ) -> Result<(MessageId, ProgramId), Error> { + ) -> Result<(MessageId, ProgramId), Error> { let program_id = packet.destination(); if self.store.initialized.contains(&program_id) { - return Err(Error::DuplicateInit); + return Err(Error::DuplicateInit); } let last = self.store.local_nonce; if last >= self.settings.outgoing_limit { - return Err(Error::OutgoingMessagesAmountLimitExceeded); + return Err(Error::OutgoingMessagesAmountLimitExceeded); } let message_id = MessageId::generate_outgoing(self.current.id(), last); @@ -1465,13 +1465,13 @@ mut packet: HandlePacket, delay: u32, reservation: Option<ReservationId>, - ) -> Result<MessageId, Error> { + ) -> Result<MessageId, Error> { let outgoing = self .outgoing_payloads .handles .get_mut(&handle) - .ok_or(Error::OutOfBounds)?; - let data = outgoing.take().ok_or(Error::LateAccess)?; + .ok_or(Error::OutOfBounds)?; + let data = outgoing.take().ok_or(Error::LateAccess)?; let do_send_commit = || { let Some(new_outgoing_bytes) = Self::increase_counter( @@ -1479,12 +1479,12 @@ packet.payload_len(), self.settings.outgoing_bytes_limit, ) else { - return Err((Error::OutgoingMessagesBytesLimitExceeded, data)); + return Err((Error::OutgoingMessagesBytesLimitExceeded, data)); }; packet .try_prepend(data) - .map_err(|data| (Error::MaxMessageSizeExceed, data))?; + .map_err(|data| (Error::MaxMessageSizeExceed, data))?; let message_id = MessageId::generate_outgoing(self.current.id(), handle); let message = HandleMessage::from_packet(message_id, packet); @@ -1512,7 +1512,7 @@ /// Provide space for storing payload for future message creation. /// /// Returns it's handle. - pub fn send_init(&mut self) -> Result<u32, Error> { + pub fn send_init(&mut self) -> Result<u32, Error> { let last = self.store.local_nonce; if last < self.settings.outgoing_limit { self.store.local_nonce += 1; @@ -1522,16 +1522,16 @@ Ok(last) } else { - Err(Error::OutgoingMessagesAmountLimitExceeded) + Err(Error::OutgoingMessagesAmountLimitExceeded) } } /// Pushes payload into stored payload by handle. - pub fn send_push(&mut self, handle: u32, buffer: &[u8]) -> Result<(), Error> { + pub fn send_push(&mut self, handle: u32, buffer: &[u8]) -> Result<(), Error> { let data = match self.outgoing_payloads.handles.get_mut(&handle) { Some(Some(data)) => data, - Some(None) => return Err(Error::LateAccess), - None => return Err(Error::OutOfBounds), + Some(None) => return Err(Error::LateAccess), + None => return Err(Error::OutOfBounds), }; let new_outgoing_bytes = Self::increase_counter( @@ -1539,10 +1539,10 @@ buffer.len(), self.settings.outgoing_bytes_limit, ) - .ok_or(Error::OutgoingMessagesBytesLimitExceeded)?; + .ok_or(Error::OutgoingMessagesBytesLimitExceeded)?; data.try_extend_from_slice(buffer) - .map_err(|_| Error::MaxMessageSizeExceed)?; + .map_err(|_| Error::MaxMessageSizeExceed)?; self.outgoing_payloads.bytes_counter = new_outgoing_bytes; @@ -1550,11 +1550,11 @@ } /// Pushes the incoming buffer/payload into stored payload by handle. - pub fn send_push_input(&mut self, handle: u32, range: CheckedRange) -> Result<(), Error> { + pub fn send_push_input(&mut self, handle: u32, range: CheckedRange) -> Result<(), Error> { let data = match self.outgoing_payloads.handles.get_mut(&handle) { Some(Some(data)) => data, - Some(None) => return Err(Error::LateAccess), - None => return Err(Error::OutOfBounds), + Some(None) => return Err(Error::LateAccess), + None => return Err(Error::OutOfBounds), }; let bytes_amount = range.len(); @@ -1568,10 +1568,10 @@ bytes_amount, self.settings.outgoing_bytes_limit, ) - .ok_or(Error::OutgoingMessagesBytesLimitExceeded)?; + .ok_or(Error::OutgoingMessagesBytesLimitExceeded)?; data.try_extend_from_slice(&self.current.payload_bytes()[offset..excluded_end]) - .map_err(|_| Error::MaxMessageSizeExceed)?; + .map_err(|_| Error::MaxMessageSizeExceed)?; self.outgoing_payloads.bytes_counter = new_outgoing_bytes; @@ -1582,20 +1582,20 @@ /// limits. Result `CheckedRange` instance is accepted by /// `send_push_input`/`reply_push_input` and has the method `len` /// allowing to charge gas before the calls. - pub fn check_input_range(&self, offset: u32, len: u32) -> Result<CheckedRange, Error> { + pub fn check_input_range(&self, offset: u32, len: u32) -> Result<CheckedRange, Error> { let input = self.current.payload_bytes(); let offset = offset as usize; let len = len as usize; // Check `offset` is not out of bounds. if offset >= input.len() { - return Err(Error::OutOfBoundsInputSliceOffset); + return Err(Error::OutOfBoundsInputSliceOffset); } // Check `len` for the current `offset` doesn't refer to the slice out of input bounds. let available_len = input.len() - offset; if len > available_len { - return Err(Error::OutOfBoundsInputSliceLength); + return Err(Error::OutOfBoundsInputSliceLength); } Ok(CheckedRange { @@ -1613,18 +1613,18 @@ &mut self, mut packet: ReplyPacket, reservation: Option<ReservationId>, - ) -> Result<MessageId, ExtError> { + ) -> Result<MessageId, ExtError> { self.check_reply_availability()?; if self.reply_sent() { - return Err(Error::DuplicateReply.into()); + return Err(Error::DuplicateReply.into()); } let data = self.outgoing_payloads.reply.take().unwrap_or_default(); if let Err(data) = packet.try_prepend(data) { self.outgoing_payloads.reply = Some(data); - return Err(Error::MaxMessageSizeExceed.into()); + return Err(Error::MaxMessageSizeExceed.into()); } let message_id = MessageId::generate_reply(self.current.id()); @@ -1636,11 +1636,11 @@ } /// Pushes payload into stored reply payload. - pub fn reply_push(&mut self, buffer: &[u8]) -> Result<(), ExtError> { + pub fn reply_push(&mut self, buffer: &[u8]) -> Result<(), ExtError> { self.check_reply_availability()?; if self.reply_sent() { - return Err(Error::LateAccess.into()); + return Err(Error::LateAccess.into()); } // NOTE: it's normal to not undone `get_or_insert_with` in case of error @@ -1648,7 +1648,7 @@ .reply .get_or_insert_with(Default::default) .try_extend_from_slice(buffer) - .map_err(|_| Error::MaxMessageSizeExceed.into()) + .map_err(|_| Error::MaxMessageSizeExceed.into()) } /// Return reply destination. @@ -1657,11 +1657,11 @@ } /// Pushes the incoming message buffer into stored reply payload. - pub fn reply_push_input(&mut self, range: CheckedRange) -> Result<(), ExtError> { + pub fn reply_push_input(&mut self, range: CheckedRange) -> Result<(), ExtError> { self.check_reply_availability()?; if self.reply_sent() { - return Err(Error::LateAccess.into()); + return Err(Error::LateAccess.into()); } let CheckedRange { @@ -1674,16 +1674,16 @@ .reply .get_or_insert_with(Default::default) .try_extend_from_slice(&self.current.payload_bytes()[offset..excluded_end]) - .map_err(|_| Error::MaxMessageSizeExceed.into()) + .map_err(|_| Error::MaxMessageSizeExceed.into()) } /// Wake message by it's message id. - pub fn wake(&mut self, waker_id: MessageId, delay: u32) -> Result<(), Error> { + pub fn wake(&mut self, waker_id: MessageId, delay: u32) -> Result<(), Error> { if !self.outcome.awakening.iter().any(|v| v.0 == waker_id) { self.outcome.awakening.push((waker_id, delay)); Ok(()) } else { - Err(Error::DuplicateWaking) + Err(Error::DuplicateWaking) } } @@ -1692,14 +1692,14 @@ &mut self, message_id: MessageId, amount: u64, - ) -> Result<(), MessageError> { + ) -> Result<(), MessageError> { if self .outcome .reply_deposits .iter() .any(|(mid, _)| mid == &message_id) { - return Err(MessageError::DuplicateReplyDeposit); + return Err(MessageError::DuplicateReplyDeposit); } if !self @@ -1713,7 +1713,7 @@ .iter() .any(|(message, ..)| message.id() == message_id) { - return Err(MessageError::IncorrectMessageForReplyDeposit); + return Err(MessageError::IncorrectMessageForReplyDeposit); } self.outcome.reply_deposits.push((message_id, amount)); diff --git a/pr-4404/src/gear_core/message/reply.rs.html b/pr-4404/src/gear_core/message/reply.rs.html index cfebb0d3865..19c80b22335 100644 --- a/pr-4404/src/gear_core/message/reply.rs.html +++ b/pr-4404/src/gear_core/message/reply.rs.html @@ -467,7 +467,7 @@ pub fn system(payload: Payload, err: impl Into<ErrorReplyReason>) -> Self { Self { payload, - code: ReplyCode::error(err), + code: ReplyCode::error(err), ..Default::default() } } diff --git a/pr-4404/src/gear_core/message/signal.rs.html b/pr-4404/src/gear_core/message/signal.rs.html index 0a50885723f..4d40f382efe 100644 --- a/pr-4404/src/gear_core/message/signal.rs.html +++ b/pr-4404/src/gear_core/message/signal.rs.html @@ -96,7 +96,7 @@ ids::{prelude::*, MessageId, ProgramId}, message::{Dispatch, DispatchKind, Message, SignalDetails}, }; -use gear_core_errors::SignalCode; +use gear_core_errors::SignalCode; use scale_info::{ scale::{Decode, Encode}, TypeInfo, @@ -108,12 +108,12 @@ /// Message id. id: MessageId, /// Reply status code. - code: SignalCode, + code: SignalCode, } impl SignalMessage { /// Creates a new [`SignalMessage`]. - pub fn new(origin_msg_id: MessageId, code: SignalCode) -> Self { + pub fn new(origin_msg_id: MessageId, code: SignalCode) -> Self { let id = MessageId::generate_signal(origin_msg_id); Self { id, code } @@ -146,7 +146,7 @@ } /// Status code of the reply message. - pub fn code(&self) -> SignalCode { + pub fn code(&self) -> SignalCode { self.code } } diff --git a/pr-4404/src/gear_core/reservation.rs.html b/pr-4404/src/gear_core/reservation.rs.html index 7a01edad7a6..68265bfcbe9 100644 --- a/pr-4404/src/gear_core/reservation.rs.html +++ b/pr-4404/src/gear_core/reservation.rs.html @@ -580,7 +580,7 @@ message::IncomingDispatch, }; use alloc::{collections::BTreeMap, format}; -use gear_core_errors::ReservationError; +use gear_core_errors::ReservationError; use scale_info::{ scale::{Decode, Encode}, TypeInfo, @@ -693,7 +693,7 @@ /// in the `states` is less than `max_reservations`. Removed reservations, /// which are stored with the [`GasReservationState::Removed`] state in the /// `states`, aren't excluded from the check. - fn check_execution_limit(&self) -> Result<(), ReservationError> { + fn check_execution_limit(&self) -> Result<(), ReservationError> { // operation might very expensive in the future // so we will store 2 numerics to optimize it maybe let current_reservations = self @@ -707,7 +707,7 @@ }) .sum::<u64>(); if current_reservations > self.max_reservations { - Err(ReservationError::ReservationsLimitReached) + Err(ReservationError::ReservationsLimitReached) } else { Ok(()) } @@ -731,7 +731,7 @@ &mut self, amount: u64, duration: u32, - ) -> Result<ReservationId, ReservationError> { + ) -> Result<ReservationId, ReservationError> { self.check_execution_limit()?; let id = ReservationId::generate(self.message_id, self.nonce.fetch_inc()); @@ -769,12 +769,12 @@ pub fn unreserve( &mut self, id: ReservationId, - ) -> Result<(u64, Option<UnreservedReimbursement>), ReservationError> { + ) -> Result<(u64, Option<UnreservedReimbursement>), ReservationError> { // Docs error case #1. let state = self .states .get(&id) - .ok_or(ReservationError::InvalidReservationId)?; + .ok_or(ReservationError::InvalidReservationId)?; if matches!( state, @@ -784,7 +784,7 @@ GasReservationState::Exists { used: true, .. } | GasReservationState::Created { used: true, .. } ) { - return Err(ReservationError::InvalidReservationId); + return Err(ReservationError::InvalidReservationId); } let state = self.states.remove(&id).unwrap(); @@ -813,7 +813,7 @@ /// This allows to avoid double usage of the reservation /// for sending a new message from execution of `message_id` /// of current gas reserver. - pub fn mark_used(&mut self, id: ReservationId) -> Result<(), ReservationError> { + pub fn mark_used(&mut self, id: ReservationId) -> Result<(), ReservationError> { let used = self.check_not_used(id)?; *used = true; Ok(()) @@ -822,18 +822,18 @@ /// Check if reservation is not used. /// /// If reservation does not exist returns `InvalidReservationId` error. - pub fn check_not_used(&mut self, id: ReservationId) -> Result<&mut bool, ReservationError> { + pub fn check_not_used(&mut self, id: ReservationId) -> Result<&mut bool, ReservationError> { if let Some( GasReservationState::Created { used, .. } | GasReservationState::Exists { used, .. }, ) = self.states.get_mut(&id) { if *used { - Err(ReservationError::InvalidReservationId) + Err(ReservationError::InvalidReservationId) } else { Ok(used) } } else { - Err(ReservationError::InvalidReservationId) + Err(ReservationError::InvalidReservationId) } }