/// Sets the callbacks that will get called at this supervisor's
/// different lifecycle events.
///
/// See [`Callbacks`]'s documentation for more information about the
/// different callbacks available.
///
/// # Arguments
///
/// * `callbacks` - The callbacks that will get called for this
///     supervisor.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # fn main() {
///     # Bastion::init();
///     #
/// Bastion::supervisor(|sp| {
///     let callbacks = Callbacks::new()
///         .with_before_start(|| println!("Supervisor started."))
///         .with_after_stop(|| println!("Supervisor stopped."));
///
///     sp.with_callbacks(callbacks)
/// }).expect("Couldn't create the supervisor.");
///     #
///     # Bastion::start();
///     # Bastion::stop();
///     # Bastion::block_until_stopped();
/// # }
/// ```
///
/// [`Callbacks`]: struct.Callbacks.html
Sets the callbacks that will get called at this supervisor's
different lifecycle events.

See [`Callbacks`]'s documentation for more information about the
different callbacks available.
Sets the callbacks that will get called at this supervisor ' s different lifecycle events . See [ ` Callbacks ` ] ' s documentation for more information about the different callbacks available .
pub fn with_callbacks(mut self, callbacks: Callbacks) -> Self {
        trace!(
            "Supervisor({}): Setting callbacks: {:?}",
            self.id(),
            callbacks
        );
        self.callbacks = callbacks;
        self
    }
pub fn with_callbacks ( mut self , callbacks : Callbacks ) -> Self { trace ! ( " " self id ( ) callbacks ) ; self . callbacks = callbacks ; self }
Sets the callbacks that will get called at this supervisor's
different lifecycle events.
Sets the callbacks that will get called at this supervisor ' s different lifecycle events .
mut self
callbacks
Callbacks
example
None
use bastion::prelude::*;
None
fn main() {


:supervisor(|sp| {
let callbacks = Callbacks::new()
.with_before_start(|| println!("Supervisor started."))
.with_after_stop(|| println!("Supervisor stopped.")).

sp.with_callbacks(callbacks)
}).expect("Couldn't create the supervisor.").

:start();
Bastion::stop();
Bastion::block_until_stopped().
: supervisor ( |sp| { let callbacks = Callbacks :: new () . with_before_start ( || println! ( " Supervisor started . " )) . with_after_stop ( || println! ( " Supervisor stopped . " )) . sp . with_callbacks ( callbacks ) } ) . expect ( " Couldn ' t create the supervisor . " ) . : start () ; Bastion :: stop () ; Bastion :: block_until_stopped () .
}
None