pub struct Slot<T> { /* private fields */ }
Expand description
A mutable memory location with atomic storage rules.
Implementations§
source§impl<T> Slot<T>
impl<T> Slot<T>
source§impl<T: Default> Slot<T>
impl<T: Default> Slot<T>
sourcepub fn with_default() -> Self
pub fn with_default() -> Self
Creates a new slot containing the default instance of T
.
sourcepub fn store_if_unset(&self, value: Arc<T>)
pub fn store_if_unset(&self, value: Arc<T>)
Replaces the data if the slot is empty.
Trait Implementations§
source§impl<'de, T: Deserialize<'de>> Deserialize<'de> for Slot<T>
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Slot<T>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Filter + Default> Filter for Slot<T>
impl<T: Filter + Default> Filter for Slot<T>
source§fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut ReadContext
) -> Pin<Box<dyn Future<Output = Result<(), FilterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut ReadContext
) -> Pin<Box<dyn Future<Output = Result<(), FilterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Filter::read
is invoked when the proxy receives data from a
downstream connection on the listening port. Read moresource§fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut WriteContext
) -> Pin<Box<dyn Future<Output = Result<(), FilterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut WriteContext
) -> Pin<Box<dyn Future<Output = Result<(), FilterError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Filter::write
is invoked when the proxy is about to send data to a
downstream connection via the listening port after receiving it via one
of the upstream Endpoints. Read moresource§impl<T: JsonSchema + Default> JsonSchema for Slot<T>
impl<T: JsonSchema + Default> JsonSchema for Slot<T>
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreAuto Trait Implementations§
impl<T> !RefUnwindSafe for Slot<T>
impl<T> Send for Slot<T>
impl<T> Sync for Slot<T>
impl<T> Unpin for Slot<T>
impl<T> !UnwindSafe for Slot<T>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request