mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-18 18:12:32 +00:00
merge
This commit is contained in:
commit
3be023c804
@ -191,6 +191,18 @@ pub struct MessageTypes {
|
||||
}
|
||||
|
||||
impl MessageTypes {
|
||||
/// Builds a `MessageTypes` with all fields set to `true`.
|
||||
#[inline]
|
||||
pub fn all() -> MessageTypes {
|
||||
MessageTypes {
|
||||
error: true,
|
||||
warning: true,
|
||||
performance_warning: true,
|
||||
information: true,
|
||||
debug: true,
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds a `MessageTypes` with all fields set to `false` expect `error`.
|
||||
#[inline]
|
||||
pub fn errors() -> MessageTypes {
|
||||
@ -255,3 +267,22 @@ impl From<Error> for DebugCallbackCreationError {
|
||||
panic!("unexpected error: {:?}", err)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for MessageTypes {
|
||||
#[inline]
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
if self.error {
|
||||
write!(fmt, "error")
|
||||
} else if self.warning {
|
||||
write!(fmt, "warning")
|
||||
} else if self.performance_warning {
|
||||
write!(fmt, "performance_warning")
|
||||
} else if self.information {
|
||||
write!(fmt, "information")
|
||||
} else if self.debug {
|
||||
write!(fmt, "debug")
|
||||
} else {
|
||||
write!(fmt, "{:?}", self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user