pub enum Message {
System(SystemMessage),
User {
application_id: ApplicationId,
bytes: Vec<u8>,
},
}
Expand description
A message to be sent and possibly executed in the receiver’s block.
Variants§
Implementations§
Source§impl Message
impl Message
pub fn system(message: SystemMessage) -> Message
pub fn user<A, M>( application_id: ApplicationId<A>, message: &M, ) -> Result<Message, Error>
pub fn application_id(&self) -> GenericApplicationId
Sourcepub fn goes_to_inbox(&self) -> bool
pub fn goes_to_inbox(&self) -> bool
Returns whether this message must be added to the inbox.
pub fn matches_subscribe(&self) -> Option<(&ChainId, &ChannelSubscription)>
pub fn matches_unsubscribe(&self) -> Option<(&ChainId, &ChannelSubscription)>
pub fn matches_open_chain(&self) -> Option<&OpenChainConfig>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<SystemMessage> for Message
impl From<SystemMessage> for Message
Source§fn from(message: SystemMessage) -> Message
fn from(message: SystemMessage) -> Message
Converts to this type from the input type.
Source§impl InputType for Message
impl InputType for Message
Source§type RawValueType = Message
type RawValueType = Message
The raw type used for validator. Read more
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§fn parse(value: Option<ConstValue>) -> Result<Message, InputValueError<Message>>
fn parse(value: Option<ConstValue>) -> Result<Message, InputValueError<Message>>
Parse from
Value
. None represents undefined.Source§fn to_value(&self) -> ConstValue
fn to_value(&self) -> ConstValue
Convert to a
Value
for introspection.Source§fn as_raw_value(&self) -> Option<&<Message as InputType>::RawValueType>
fn as_raw_value(&self) -> Option<&<Message as InputType>::RawValueType>
Returns a reference to the raw value.
Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl OutputType for Message
impl OutputType for Message
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§async fn resolve(
&self,
_: &ContextBase<'_, &Positioned<SelectionSet>>,
_field: &Positioned<Field>,
) -> Result<ConstValue, ServerError>
async fn resolve( &self, _: &ContextBase<'_, &Positioned<SelectionSet>>, _field: &Positioned<Field>, ) -> Result<ConstValue, ServerError>
Resolve an output value to
async_graphql::Value
.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl ScalarType for Message
impl ScalarType for Message
Source§fn parse(value: ConstValue) -> Result<Message, InputValueError<Message>>
fn parse(value: ConstValue) -> Result<Message, InputValueError<Message>>
Parse a scalar value.
Source§fn to_value(&self) -> ConstValue
fn to_value(&self) -> ConstValue
Convert the scalar to
Value
.Source§impl Serialize for Message
impl Serialize for Message
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Source§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length
bytes from memory from the provided location
.
Source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes
to memory at the provided location
.