pub struct Info {
pub title: String,
pub text: String,
pub error: bool,
pub copy: bool,
pub details: Details,
}Expand description
Something to read and acknowledge: a message, or an error
(Info::error).
use egui_pop_api::dialogs::{DetailsMode, Info};
let failed = Info::error("Export failed", "The disk is full.")
.details([("version", "1.2.0"), ("job", "42")], DetailsMode::Auto);
assert!(failed.details.shown(failed.error));
assert_eq!(
failed.copy_text(),
"Export failed\n\nThe disk is full.\n\n---\nversion: 1.2.0\njob: 42"
);Fields§
§title: String§text: String§error: boolAn error: its details are shown (collapsed) by default.
copy: boolThe Copy button in its bottom corner (on by default).
details: DetailsTechnical lines for a bug report (none by default).
Implementations§
Source§impl Info
impl Info
pub fn new(title: &str, text: &str) -> Self
Sourcepub fn error(title: &str, text: &str) -> Self
pub fn error(title: &str, text: &str) -> Self
An error to acknowledge: its details are shown by default, in a collapsed “Details” section.
Sourcepub fn details<K: Into<String>, V: Into<String>>(
self,
lines: impl IntoIterator<Item = (K, V)>,
mode: DetailsMode,
) -> Self
pub fn details<K: Into<String>, V: Into<String>>( self, lines: impl IntoIterator<Item = (K, V)>, mode: DetailsMode, ) -> Self
With technical details: key-value lines the Copy button appends to
the copied text, hidden or shown (DetailsMode; shown on an
error, hidden otherwise, by default).
Trait Implementations§
Source§impl From<Info> for DialogSpec
impl From<Info> for DialogSpec
impl StructuralPartialEq for Info
Auto Trait Implementations§
impl Freeze for Info
impl RefUnwindSafe for Info
impl Send for Info
impl Sync for Info
impl Unpin for Info
impl UnsafeUnpin for Info
impl UnwindSafe for Info
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more