pub struct MessagePolicy {
pub blanket: BlanketMessagePolicy,
pub restrict_chain_ids_to: Option<HashSet<ChainId>>,
pub reject_message_bundles_without_application_ids: Option<HashSet<GenericApplicationId>>,
pub reject_message_bundles_with_other_application_ids: Option<HashSet<GenericApplicationId>>,
pub process_events_from_application_ids: Option<HashSet<GenericApplicationId>>,
pub never_reject_application_ids: HashSet<GenericApplicationId>,
}Expand description
Policies for automatically handling incoming messages.
Fields§
§blanket: BlanketMessagePolicyThe blanket policy applied to all messages.
restrict_chain_ids_to: Option<HashSet<ChainId>>A collection of chains which restrict the origin of messages to be
accepted. Option::None means that messages from all chains are accepted. An empty
HashSet denotes that messages from no chains are accepted.
reject_message_bundles_without_application_ids: Option<HashSet<GenericApplicationId>>A collection of applications: If Some, only bundles with at least one message by any
of these applications will be accepted.
reject_message_bundles_with_other_application_ids: Option<HashSet<GenericApplicationId>>A collection of applications: If Some, only bundles all of whose messages are by these
applications will be accepted.
process_events_from_application_ids: Option<HashSet<GenericApplicationId>>A collection of applications: If Some, only event streams from those
applications will be processed.
never_reject_application_ids: HashSet<GenericApplicationId>A collection of applications whose messages must never be rejected. Bundles whose
messages are all from one of these applications bypass the other rejection rules
(except restrict_chain_ids_to), and on execution failure they are discarded for
later retry instead of being rejected. A bundle that contains any message from an
application not on this list can be rejected. An empty set disables this feature.
Implementations§
Source§impl MessagePolicy
impl MessagePolicy
pub async fn blanket(&self, ctx: &Context<'_>) -> Result<&BlanketMessagePolicy>
pub async fn restrict_chain_ids_to( &self, ctx: &Context<'_>, ) -> Result<&Option<HashSet<ChainId>>>
pub async fn reject_message_bundles_without_application_ids( &self, ctx: &Context<'_>, ) -> Result<&Option<HashSet<GenericApplicationId>>>
pub async fn reject_message_bundles_with_other_application_ids( &self, ctx: &Context<'_>, ) -> Result<&Option<HashSet<GenericApplicationId>>>
pub async fn process_events_from_application_ids( &self, ctx: &Context<'_>, ) -> Result<&Option<HashSet<GenericApplicationId>>>
pub async fn never_reject_application_ids( &self, ctx: &Context<'_>, ) -> Result<&HashSet<GenericApplicationId>>
Trait Implementations§
Source§impl Clone for MessagePolicy
impl Clone for MessagePolicy
Source§fn clone(&self) -> MessagePolicy
fn clone(&self) -> MessagePolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ContainerType for MessagePolicy
impl ContainerType for MessagePolicy
Source§async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async_graphql::Value. Read moreSource§fn collect_all_fields<'a>(
&'a self,
ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>,
fields: &mut Fields<'a>,
) -> Result<(), ServerError>
fn collect_all_fields<'a>( &'a self, ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>, fields: &mut Fields<'a>, ) -> Result<(), ServerError>
Source§fn find_entity(
&self,
_: &ContextBase<'_, &Positioned<Field>>,
_params: &ConstValue,
) -> impl Future<Output = Result<Option<ConstValue>, ServerError>> + Send
fn find_entity( &self, _: &ContextBase<'_, &Positioned<Field>>, _params: &ConstValue, ) -> impl Future<Output = Result<Option<ConstValue>, ServerError>> + Send
Source§impl Debug for MessagePolicy
impl Debug for MessagePolicy
Source§impl Default for MessagePolicy
impl Default for MessagePolicy
Source§fn default() -> MessagePolicy
fn default() -> MessagePolicy
Source§impl<'de> Deserialize<'de> for MessagePolicy
impl<'de> Deserialize<'de> for MessagePolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl OutputType for MessagePolicy
impl OutputType for MessagePolicy
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Source§async fn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
_field: &Positioned<Field>,
) -> ServerResult<Value>
async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>
async_graphql::Value.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Source§impl PartialEq for MessagePolicy
impl PartialEq for MessagePolicy
Source§impl Serialize for MessagePolicy
impl Serialize for MessagePolicy
impl ObjectType for MessagePolicy
impl StructuralPartialEq for MessagePolicy
Auto Trait Implementations§
impl Freeze for MessagePolicy
impl RefUnwindSafe for MessagePolicy
impl Send for MessagePolicy
impl Sync for MessagePolicy
impl Unpin for MessagePolicy
impl UnwindSafe for MessagePolicy
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> 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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T> MockResults for T
impl<T> MockResults for T
Source§type Results = T
type Results = T
MockInstance.Source§impl<T> Pointable for T
impl<T> Pointable for T
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.