BaseMessage

Struct BaseMessage 

Source
pub struct BaseMessage<I, B> {
    pub info: I,
    pub init: Option<StateInit>,
    pub body: B,
    pub layout: Option<MessageLayout>,
}
Expand description

Blockchain message.

Fields§

§info: I

Message info.

§init: Option<StateInit>

Optional state init.

§body: B

Optional payload.

§layout: Option<MessageLayout>

Optional message layout.

Implementations§

Source§

impl<I: Borrow<MsgInfo>, B> BaseMessage<I, B>

Source

pub fn ty(&self) -> MsgType

Returns the type of this message.

Source§

impl<I: ExactSize, B: ExactSize> BaseMessage<I, B>

Source

pub fn compute_layout( info: &I, init: Option<&StateInit>, body: &B, ) -> MessageLayout

Computes the most optimal layout of the message parts.

Trait Implementations§

Source§

impl<I: Clone, B: Clone> Clone for BaseMessage<I, B>

Source§

fn clone(&self) -> BaseMessage<I, B>

Returns a duplicate 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<I: Debug, B: Debug> Debug for BaseMessage<I, B>

Source§

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

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

impl<'de, I> Deserialize<'de> for BaseMessage<I, CellSliceParts>
where for<'a> I: ExactSize + Load<'a> + Deserialize<'de>,

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

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

impl<'a, I, B> Load<'a> for BaseMessage<I, B>
where I: Load<'a>, B: LoadBody<'a>,

Source§

fn load_from(slice: &mut CellSlice<'a>) -> Result<Self, Error>

Tries to load itself from a cell slice.
Source§

impl<I, B> Serialize for BaseMessage<I, B>
where I: ExactSize + Store + Serialize, B: ExactSize + StoreBody,

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

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

impl<I, B> Store for BaseMessage<I, B>
where I: Store + ExactSize, B: StoreBody + ExactSize,

Source§

fn store_into( &self, builder: &mut CellBuilder, context: &mut dyn CellContext, ) -> Result<(), Error>

Tries to store itself into the cell builder.
Source§

impl EquivalentRepr<BaseMessage<MsgInfo, (Cell, CellSliceRange)>> for Message<'_>

Source§

impl EquivalentRepr<BaseMessage<MsgInfo, (Cell, CellSliceRange)>> for OwnedRelaxedMessage

Source§

impl EquivalentRepr<BaseMessage<MsgInfo, (Cell, CellSliceRange)>> for RelaxedMessage<'_>

Source§

impl EquivalentRepr<BaseMessage<MsgInfo, CellSlice<'_>>> for OwnedMessage

Source§

impl EquivalentRepr<BaseMessage<MsgInfo, CellSlice<'_>>> for OwnedRelaxedMessage

Source§

impl EquivalentRepr<BaseMessage<MsgInfo, CellSlice<'_>>> for RelaxedMessage<'_>

Source§

impl EquivalentRepr<BaseMessage<RelaxedMsgInfo, (Cell, CellSliceRange)>> for OwnedMessage

Source§

impl EquivalentRepr<BaseMessage<RelaxedMsgInfo, (Cell, CellSliceRange)>> for Message<'_>

Source§

impl EquivalentRepr<BaseMessage<RelaxedMsgInfo, (Cell, CellSliceRange)>> for RelaxedMessage<'_>

Source§

impl EquivalentRepr<BaseMessage<RelaxedMsgInfo, CellSlice<'_>>> for OwnedMessage

Source§

impl EquivalentRepr<BaseMessage<RelaxedMsgInfo, CellSlice<'_>>> for Message<'_>

Source§

impl EquivalentRepr<BaseMessage<RelaxedMsgInfo, CellSlice<'_>>> for OwnedRelaxedMessage

Auto Trait Implementations§

§

impl<I, B> Freeze for BaseMessage<I, B>
where I: Freeze, B: Freeze,

§

impl<I, B> !RefUnwindSafe for BaseMessage<I, B>

§

impl<I, B> Send for BaseMessage<I, B>
where I: Send, B: Send,

§

impl<I, B> Sync for BaseMessage<I, B>
where I: Sync, B: Sync,

§

impl<I, B> Unpin for BaseMessage<I, B>
where I: Unpin, B: Unpin,

§

impl<I, B> !UnwindSafe for BaseMessage<I, B>

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 T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> EquivalentRepr<T> for T