Struct MessageType
pub struct MessageType<T> { /* private fields */ }Expand description
An instance of a MessageType represents a single message type in the Kanzi message system.
A message type exists throughout the lifetime of an application.
Implementations§
§impl<T> MessageType<T>
impl<T> MessageType<T>
§impl<T> MessageType<T>
impl<T> MessageType<T>
pub fn get_arguments_metaclass(&self) -> Result<Metaclass, Error>
pub fn get_arguments_metaclass(&self) -> Result<Metaclass, Error>
Gets the metaclass of the message arguments associated with the message type.
pub fn get_name(&self) -> Result<KanziString, Error>
pub fn get_name(&self) -> Result<KanziString, Error>
Gets the fully qualified name of the message type in the form “Class.MessageType”.
pub fn get_routing(&self) -> Result<MessageRouting, Error>
pub fn get_routing(&self) -> Result<MessageRouting, Error>
Gets the message routing of the message type.
pub fn compare(&self, rhs: &MessageType<T>) -> Result<bool, Error>
pub fn compare(&self, rhs: &MessageType<T>) -> Result<bool, Error>
Compares two message types.
pub fn get_editor_info(&self) -> Result<Option<EditorInfo>, Error>
pub fn get_editor_info(&self) -> Result<Option<EditorInfo>, Error>
Gets editor info for the message type.
§impl MessageType<MessageArguments>
impl MessageType<MessageArguments>
pub fn find(
domain: &Domain,
name: impl AsRef<KanziStr>,
) -> Result<Option<MessageType<MessageArguments>>, Error>
pub fn find( domain: &Domain, name: impl AsRef<KanziStr>, ) -> Result<Option<MessageType<MessageArguments>>, Error>
Finds a registered message type by name.
§impl<T> MessageType<T>where
T: MessageArgumentsConstraint,
impl<T> MessageType<T>where
T: MessageArgumentsConstraint,
pub fn as_abstract(&self) -> &MessageType<MessageArguments>
pub fn as_abstract(&self) -> &MessageType<MessageArguments>
Casts a MessageType reference to its abstract representation.
pub fn to_abstract(self) -> MessageType<MessageArguments>
pub fn to_abstract(self) -> MessageType<MessageArguments>
Casts a MessageType to its abstract representation.
Useful for returning a typed MessageType in callbacks that expect a generic MessageType.
pub fn create_args(&self, domain: &Domain) -> Result<T, Error>
pub fn create_args(&self, domain: &Domain) -> Result<T, Error>
Creates an instance of MessageArguments for the specified message type.
Trait Implementations§
§impl<T> Debug for MessageType<T>
impl<T> Debug for MessageType<T>
§impl<T> PartialEq for MessageType<T>
impl<T> PartialEq for MessageType<T>
impl<T> Eq for MessageType<T>
impl<T> Sync for MessageType<T>
Auto Trait Implementations§
impl<T> Freeze for MessageType<T>
impl<T> RefUnwindSafe for MessageType<T>where
T: RefUnwindSafe,
impl<T> !Send for MessageType<T>
impl<T> Unpin for MessageType<T>where
T: Unpin,
impl<T> UnwindSafe for MessageType<T>where
T: UnwindSafe,
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