pub struct BosonState {
pub boson: Arc<Boson>,
}Expand description
Extractable state holding a Boson runtime.
Construct with BosonState::new after BosonBuilder::build
and inject via FromRef (see the crate example).
Fields§
§boson: Arc<Boson>Boson runtime for admin and enqueue operations.
Implementations§
Source§impl BosonState
impl BosonState
Sourcepub const fn new(boson: Arc<Boson>) -> BosonState
pub const fn new(boson: Arc<Boson>) -> BosonState
Create state from a shared Boson instance.
use std::sync::Arc;
use boson_axum::BosonState;
use boson_runtime::Boson;
let state = BosonState::new(Arc::new(boson));Trait Implementations§
Source§impl Clone for BosonState
impl Clone for BosonState
Source§fn clone(&self) -> BosonState
fn clone(&self) -> BosonState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BosonState
impl !UnwindSafe for BosonState
impl Freeze for BosonState
impl Send for BosonState
impl Sync for BosonState
impl Unpin for BosonState
impl UnsafeUnpin for BosonState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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