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<P: PacketMut>(
&self,
ctx: &mut ReadContext<'_, P>,
) -> Result<(), FilterError>
fn read<P: PacketMut>( &self, ctx: &mut ReadContext<'_, P>, ) -> Result<(), FilterError>
Filter::read
is invoked when the proxy receives data from a
downstream connection on the listening port. Read moreSource§fn write<P: PacketMut>(
&self,
ctx: &mut WriteContext<P>,
) -> Result<(), FilterError>
fn write<P: PacketMut>( &self, ctx: &mut WriteContext<P>, ) -> Result<(), FilterError>
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> Freeze for Slot<T>
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> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
§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