Skip to main content

LogMessage

Struct LogMessage 

Source
pub struct LogMessage {
    pub state: MessageState,
    pub message: HSTRING,
}
Expand description

Struct which represents a log message.

The ILogMessage interface represents a log message in the Command Palette. It is used to provide information about the state of the application or specific operations, and can be used for debugging or informational purposes.

Fields§

§state: MessageState

The state of the log message. This property indicates the severity or type of the log message, such as informational, warning, or error. The MessageState will specify the type.

§message: HSTRING

The message text that describes the log entry.

Implementations§

Source§

impl LogMessage

Source

pub const fn into_static(self) -> StaticComObject<Self>

This converts a partially-constructed COM object (in the sense that it contains application state but does not yet have vtable and reference count constructed) into a StaticComObject. This allows the COM object to be stored in static (global) variables.

Source§

impl LogMessage

Source

pub fn new(state: MessageState, message: HSTRING) -> Self

Creates a new LogMessage.

Source

pub fn info(message: HSTRING) -> Self

Creates a new LogMessage that represents an informational message.

Source

pub fn success(message: HSTRING) -> Self

Creates a new LogMessage that represents a success message.

Source

pub fn warning(message: HSTRING) -> Self

Creates a new LogMessage that represents a warning message.

Source

pub fn error(message: HSTRING) -> Self

Creates a new LogMessage that represents an error message.

Source

pub fn log(self)

Logs the message to the host.

The message will be logged into the log file, yet not shown to the user.

This method is a convenient wrapper around the log_message function, it consumes self, so clone the struct if you want to log it multiple times.

Trait Implementations§

Source§

impl AsImpl<LogMessage> for ILogMessage

Source§

unsafe fn as_impl_ptr(&self) -> NonNull<LogMessage>

Returns a pointer to the implementation object. Read more
Source§

unsafe fn as_impl(&self) -> &T

Safety Read more
Source§

impl Clone for LogMessage

Source§

fn clone(&self) -> LogMessage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComObjectInner for LogMessage

Source§

type Outer = LogMessage_Impl

The generated <foo>_Impl type (aka the “boxed” type or “outer” type).
Source§

fn into_object(self) -> ComObject<Self>

Moves an instance of this type into a new ComObject box and returns it. Read more
Source§

impl Debug for LogMessage

Source§

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

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

impl From<LogMessage> for IInspectable

Source§

fn from(this: LogMessage) -> Self

Converts to this type from the input type.
Source§

impl From<LogMessage> for ILogMessage

Source§

fn from(this: LogMessage) -> Self

Converts to this type from the input type.
Source§

impl From<LogMessage> for IUnknown

Source§

fn from(this: LogMessage) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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