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>

pub const fn as_ptr(&self) -> *mut MessageTypeWrapper

pub fn get_native(&self) -> Result<NonNull<c_void>, Error>

Gets a pointer to the backing C++ instance.

§

impl<T> MessageType<T>

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>

Gets the fully qualified name of the message type in the form “Class.MessageType”.

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>

Compares two message types.

pub fn get_editor_info(&self) -> Result<Option<EditorInfo>, Error>

Gets editor info for the message type.

§

impl MessageType<MessageArguments>

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>

pub fn as_abstract(&self) -> &MessageType<MessageArguments>

Casts a MessageType reference to its abstract representation.

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>

Creates an instance of MessageArguments for the specified message type.

Trait Implementations§

§

impl<T> Debug for MessageType<T>

§

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

Formats the value using the given formatter. Read more
§

impl<T> Drop for MessageType<T>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<T> PartialEq for MessageType<T>

§

fn eq(&self, rhs: &MessageType<T>) -> 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<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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Inherits<T> for T

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

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, 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.