pub struct Config { /* private fields */ }Expand description
The configuration that should be used to initialize the
system using Bastion::init_with.
The default behaviors are the following:
- All backtraces are shown (see
Config::show_backtraces).
§Example
use bastion::prelude::*;
let config = Config::new().show_backtraces();
Bastion::init_with(config);
// You can now use bastion...Implementations§
Source§impl Config
impl Config
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new configuration with the following default behaviors:
- All backtraces are shown (see
Config::show_backtraces).
Sourcepub fn show_backtraces(self) -> Self
pub fn show_backtraces(self) -> Self
Makes Bastion show all backtraces, like an application without it would. This can be useful when trying to debug children panicking.
Note that this is the default behavior.
§Example
use bastion::prelude::*;
let config = Config::new().show_backtraces();
Bastion::init_with(config);
// You can now use bastion and it will show you the
// backtraces of panics...Sourcepub fn hide_backtraces(self) -> Self
pub fn hide_backtraces(self) -> Self
Makes Bastion hide all backtraces.
Note that the default behavior is to show all backtraces
(see Config::show_backtraces).
§Example
use bastion::prelude::*;
let config = Config::new().hide_backtraces();
Bastion::init_with(config);
// You can now use bastion and no panic backtraces
// will be shown...Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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