Struct aws_smithy_http::property_bag::SharedPropertyBag [−][src]
pub struct SharedPropertyBag(_);
Expand description
A wrapper of PropertyBag
that can be safely shared across threads and cheaply cloned.
To access properties, use either acquire
or acquire_mut
. This can be one line for
single property accesses, for example:
let my_string = properties.acquire().get::<String>();
For multiple accesses, the acquire result should be stored as a local since calling acquire repeatedly will be slower than calling it once:
let props = properties.acquire();
let my_string = props.get::<String>();
let my_vec = props.get::<Vec<String>>();
Use acquire_mut
to insert properties into the bag:
properties.acquire_mut().insert("example".to_string());
Implementations
Acquire an immutable reference to the property bag.
Acquire a mutable reference to the property bag.
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for SharedPropertyBag
impl Send for SharedPropertyBag
impl Sync for SharedPropertyBag
impl Unpin for SharedPropertyBag
impl UnwindSafe for SharedPropertyBag
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more