Struct scarb_ui::components::TypedMessage
source · pub struct TypedMessage<'a> { /* private fields */ }Expand description
Generic textual message with type prefix.
Use this message type to display any kinds of warnings, errors etc. The type prefix can be stylized in text mode.
Implementations§
source§impl<'a> TypedMessage<'a>
impl<'a> TypedMessage<'a>
sourcepub fn styled(ty: &'a str, type_style: &'a str, message: &'a str) -> Self
pub fn styled(ty: &'a str, type_style: &'a str, message: &'a str) -> Self
Create a message with the given type, its style and the message text proper.
sourcepub fn naked_text(ty: &'a str, message: &'a str) -> Self
pub fn naked_text(ty: &'a str, message: &'a str) -> Self
Create a message that does not print type prefix in text mode.
Example
Scarb uses this for emitting Cairo compiler diagnostics. In text mode it prints the diagnostic as-is, while in JSON mode it wraps it as:
{"type":"diagnostic","message":"<diagnostic>"}
Trait Implementations§
source§impl<'a> Message for TypedMessage<'a>
impl<'a> Message for TypedMessage<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for TypedMessage<'a>
impl<'a> Send for TypedMessage<'a>
impl<'a> Sync for TypedMessage<'a>
impl<'a> Unpin for TypedMessage<'a>
impl<'a> UnwindSafe for TypedMessage<'a>
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