Struct evegfx::commands::strfmt::Message [−][src]
A text message that might contain formatting sequences that correspond with given arguments.
The main way to construct a Message
is using the macro
evegfx::format!
, which understands the EVE
formatting syntax just enough to automatically infer the argument types
and verify that the arguments are compatible with the format string.
Message
can also represent messages that won't be formatted at all,
although in that case it behaves just as a thin wrapper around a slice
of bytes.
Implementations
impl<'a, 'b, R: MainMem> Message<'a, 'b, R>
[src]
pub fn new(fmt: &'a [u8], args: &'b [Argument<R>]) -> Self
[src]
Construct a message with formatting arguments.
This function doesn't verify that the format string is compatible with the given arguments. If the arguments are incompatible then a generated coprocessor command would be invalid.
A Message
object only borrows the format string and argument slice
it refers to, so the caller must keep hold of those objects and
keep them in scope for the lifetime of the Message
. This type is
intended only for transient use to temporarily lend the message data
to some of the Coprocessor
methods, to copy the data into the coprocessor ring buffer.
pub fn new_literal(lit: &'a [u8]) -> Self
[src]
Constructs a message that doesn't use the formatting functionality, and instead just renders literally.
This function doesn't verify that the given message is valid. In particular, if you pass a literal containing any null bytes then a generated coprocessor commands would be invalid.
A Message
object only borrows the format string it refers to, so the
caller must keep hold of those objects and keep them in scope for the
lifetime of the Message
. This type is intended only for transient use
to temporarily lend the message data to some of the
Coprocessor
methods, to copy the data into the coprocessor ring buffer.
pub fn needs_format(&self) -> bool
[src]
Returns true if the message should be used with the format option.
Trait Implementations
impl<'a, 'b, R: Clone + MainMem> Clone for Message<'a, 'b, R>
[src]
fn clone(&self) -> Message<'a, 'b, R>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, 'b, R: Copy + MainMem> Copy for Message<'a, 'b, R>
[src]
impl<'a, 'b, R: MainMem> Debug for Message<'a, 'b, R>
[src]
Auto Trait Implementations
impl<'a, 'b, R> Send for Message<'a, 'b, R> where
R: Sync,
[src]
R: Sync,
impl<'a, 'b, R> Sync for Message<'a, 'b, R> where
R: Sync,
[src]
R: Sync,
impl<'a, 'b, R> Unpin for Message<'a, 'b, R>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,