pub struct Request<T> { /* private fields */ }
Expand description
Represents a job which can be serialized and executed
Implementations§
source§impl<T> Request<T>
impl<T> Request<T>
sourcepub fn new_with_data(req: T, data: Extensions) -> Request<T>
Available on crate feature retry
only.
pub fn new_with_data(req: T, data: Extensions) -> Request<T>
retry
only.Creates a request with context provided
Methods from Deref<Target = Extensions>§
sourcepub fn insert<T>(&mut self, val: T) -> Option<T>
pub fn insert<T>(&mut self, val: T) -> Option<T>
Insert a type into this Extensions
.
If a extension of this type already existed, it will be returned.
§Example
let mut ext = Extensions::new();
assert!(ext.insert(5i32).is_none());
assert!(ext.insert(4u8).is_none());
assert_eq!(ext.insert(9i32), Some(5i32));
sourcepub fn get<T>(&self) -> Option<&T>
pub fn get<T>(&self) -> Option<&T>
Get a reference to a type previously inserted on this Extensions
.
§Example
let mut ext = Extensions::new();
assert!(ext.get::<i32>().is_none());
ext.insert(5i32);
assert_eq!(ext.get::<i32>(), Some(&5i32));
sourcepub fn get_mut<T>(&mut self) -> Option<&mut T>
pub fn get_mut<T>(&mut self) -> Option<&mut T>
Get a mutable reference to a type previously inserted on this Extensions
.
§Example
let mut ext = Extensions::new();
ext.insert(String::from("Hello"));
ext.get_mut::<String>().unwrap().push_str(" World");
assert_eq!(ext.get::<String>().unwrap(), "Hello World");
sourcepub fn remove<T>(&mut self) -> Option<T>
pub fn remove<T>(&mut self) -> Option<T>
Remove a type from this Extensions
.
If a extension of this type existed, it will be returned.
§Example
let mut ext = Extensions::new();
ext.insert(5i32);
assert_eq!(ext.remove::<i32>(), Some(5i32));
assert!(ext.get::<i32>().is_none());
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the Extensions
of all inserted extensions.
§Example
let mut ext = Extensions::new();
ext.insert(5i32);
ext.clear();
assert!(ext.get::<i32>().is_none());
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Check whether the extension set is empty or not.
§Example
let mut ext = Extensions::new();
assert!(ext.is_empty());
ext.insert(5i32);
assert!(!ext.is_empty());
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the numer of extensions available.
§Example
let mut ext = Extensions::new();
assert_eq!(ext.len(), 0);
ext.insert(5i32);
assert_eq!(ext.len(), 1);
sourcepub fn extend(&mut self, other: Extensions)
pub fn extend(&mut self, other: Extensions)
Extends self
with another Extensions
.
If an instance of a specific type exists in both, the one in self
is overwritten with the
one from other
.
§Example
let mut ext_a = Extensions::new();
ext_a.insert(8u8);
ext_a.insert(16u16);
let mut ext_b = Extensions::new();
ext_b.insert(4u8);
ext_b.insert("hello");
ext_a.extend(ext_b);
assert_eq!(ext_a.len(), 3);
assert_eq!(ext_a.get::<u8>(), Some(&4u8));
assert_eq!(ext_a.get::<u16>(), Some(&16u16));
assert_eq!(ext_a.get::<&'static str>().copied(), Some("hello"));
Trait Implementations§
source§impl<T> Backend<Request<T>> for MemoryStorage<T>
impl<T> Backend<Request<T>> for MemoryStorage<T>
§type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
The stream to be produced by the backend
§type Layer = ServiceBuilder<Identity>
type Layer = ServiceBuilder<Identity>
Returns the final decoration of layers
source§fn common_layer(
&self,
_worker: WorkerId
) -> <MemoryStorage<T> as Backend<Request<T>>>::Layer
fn common_layer( &self, _worker: WorkerId ) -> <MemoryStorage<T> as Backend<Request<T>>>::Layer
Allows the backend to decorate the service with Layer
source§impl<T> Backend<Request<T>> for MysqlStorage<T>
impl<T> Backend<Request<T>> for MysqlStorage<T>
§type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
The stream to be produced by the backend
§type Layer = AckLayer<MysqlStorage<T>, T>
type Layer = AckLayer<MysqlStorage<T>, T>
Returns the final decoration of layers
source§fn common_layer(
&self,
worker_id: WorkerId
) -> <MysqlStorage<T> as Backend<Request<T>>>::Layer
fn common_layer( &self, worker_id: WorkerId ) -> <MysqlStorage<T> as Backend<Request<T>>>::Layer
Allows the backend to decorate the service with Layer
source§impl<T> Backend<Request<T>> for Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>
impl<T> Backend<Request<T>> for Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>
§type Stream = Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>
type Stream = Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>
The stream to be produced by the backend
§type Layer = ServiceBuilder<Identity>
type Layer = ServiceBuilder<Identity>
Returns the final decoration of layers
source§impl<T> Backend<Request<T>> for PostgresStorage<T>
impl<T> Backend<Request<T>> for PostgresStorage<T>
§type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
The stream to be produced by the backend
§type Layer = AckLayer<PostgresStorage<T>, T>
type Layer = AckLayer<PostgresStorage<T>, T>
Returns the final decoration of layers
source§fn common_layer(
&self,
worker_id: WorkerId
) -> <PostgresStorage<T> as Backend<Request<T>>>::Layer
fn common_layer( &self, worker_id: WorkerId ) -> <PostgresStorage<T> as Backend<Request<T>>>::Layer
Allows the backend to decorate the service with Layer
source§impl<T> Backend<Request<T>> for RedisStorage<T>
impl<T> Backend<Request<T>> for RedisStorage<T>
§type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
The stream to be produced by the backend
§type Layer = AckLayer<RedisStorage<T>, T>
type Layer = AckLayer<RedisStorage<T>, T>
Returns the final decoration of layers
source§fn common_layer(
&self,
worker_id: WorkerId
) -> <RedisStorage<T> as Backend<Request<T>>>::Layer
fn common_layer( &self, worker_id: WorkerId ) -> <RedisStorage<T> as Backend<Request<T>>>::Layer
Allows the backend to decorate the service with Layer
source§impl<T> Backend<Request<T>> for SqliteStorage<T>
impl<T> Backend<Request<T>> for SqliteStorage<T>
§type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
type Stream = BackendStream<Pin<Box<dyn Stream<Item = Result<Option<Request<T>>, Error>> + Send>>>
The stream to be produced by the backend
§type Layer = AckLayer<SqliteStorage<T>, T>
type Layer = AckLayer<SqliteStorage<T>, T>
Returns the final decoration of layers
source§fn common_layer(
&self,
worker_id: WorkerId
) -> <SqliteStorage<T> as Backend<Request<T>>>::Layer
fn common_layer( &self, worker_id: WorkerId ) -> <SqliteStorage<T> as Backend<Request<T>>>::Layer
Allows the backend to decorate the service with Layer
source§impl<'de, T> Deserialize<'de> for Request<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Request<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Request<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Request<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T> From<SqlRequest<T>> for Request<T>
impl<T> From<SqlRequest<T>> for Request<T>
source§fn from(val: SqlRequest<T>) -> Request<T>
fn from(val: SqlRequest<T>) -> Request<T>
Converts to this type from the input type.
source§impl<T, Res> Policy<Request<T>, Res, Error> for RetryPolicywhere
T: Clone,
Available on crate feature retry
only.
impl<T, Res> Policy<Request<T>, Res, Error> for RetryPolicywhere
T: Clone,
Available on crate feature
retry
only.source§impl<T> Serialize for Request<T>where
T: Serialize,
impl<T> Serialize for Request<T>where
T: Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl<S, J, F, Res> Service<Request<J>> for PrometheusService<S>
Available on crate feature prometheus
only.
impl<S, J, F, Res> Service<Request<J>> for PrometheusService<S>
Available on crate feature
prometheus
only.source§impl<S, J, F, Res> Service<Request<J>> for SentryJobService<S>
Available on crate feature sentry
only.
impl<S, J, F, Res> Service<Request<J>> for SentryJobService<S>
Available on crate feature
sentry
only.source§impl<J, S, OnRequestT, OnResponseT, OnFailureT, MakeSpanT, F, Res> Service<Request<J>> for Trace<S, MakeSpanT, OnRequestT, OnResponseT, OnFailureT>where
S: Service<Request<J>, Response = Res, Error = Error, Future = F> + Unpin + Send + 'static,
S::Error: Display + 'static,
MakeSpanT: MakeSpan<J>,
OnRequestT: OnRequest<J>,
OnResponseT: OnResponse<Res> + Clone + 'static,
F: Future<Output = Result<Res, Error>> + 'static,
OnFailureT: OnFailure + Clone + 'static,
Available on crate feature tracing
only.
impl<J, S, OnRequestT, OnResponseT, OnFailureT, MakeSpanT, F, Res> Service<Request<J>> for Trace<S, MakeSpanT, OnRequestT, OnResponseT, OnFailureT>where
S: Service<Request<J>, Response = Res, Error = Error, Future = F> + Unpin + Send + 'static,
S::Error: Display + 'static,
MakeSpanT: MakeSpan<J>,
OnRequestT: OnRequest<J>,
OnResponseT: OnResponse<Res> + Clone + 'static,
F: Future<Output = Result<Res, Error>> + 'static,
OnFailureT: OnFailure + Clone + 'static,
Available on crate feature
tracing
only.source§impl<S, T, Req> Service<Request<Req>> for AddExtension<S, T>
impl<S, T, Req> Service<Request<Req>> for AddExtension<S, T>
source§impl<T, F, Req, E, R> Service<Request<Req>> for ServiceFn<T, ()>
impl<T, F, Req, E, R> Service<Request<Req>> for ServiceFn<T, ()>
source§impl<T, F, Req, E, R, A1, A2> Service<Request<Req>> for ServiceFn<T, (A1, A2)>
impl<T, F, Req, E, R, A1, A2> Service<Request<Req>> for ServiceFn<T, (A1, A2)>
source§impl<T, F, Req, E, R, A1, A2, A3> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3)>
impl<T, F, Req, E, R, A1, A2, A3> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4)>
impl<T, F, Req, E, R, A1, A2, A3, A4> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5)>
impl<T, F, Req, E, R, A1, A2, A3, A4, A5> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6)>
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7)>
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8)>
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9)>
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
A14: FromData,
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
A14: FromData,
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
A14: FromData,
A15: FromData,
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
A14: FromData,
A15: FromData,
source§impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
A14: FromData,
A15: FromData,
A16: FromData,
impl<T, F, Req, E, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> Service<Request<Req>> for ServiceFn<T, (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)>where
T: FnMut(Req, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) -> F,
F: Future,
<F as Future>::Output: IntoResponse<Result = Result<R, E>>,
A1: FromData,
A2: FromData,
A3: FromData,
A4: FromData,
A5: FromData,
A6: FromData,
A7: FromData,
A8: FromData,
A9: FromData,
A10: FromData,
A11: FromData,
A12: FromData,
A13: FromData,
A14: FromData,
A15: FromData,
A16: FromData,
Auto Trait Implementations§
impl<T> Freeze for Request<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Request<T>
impl<T> Send for Request<T>where
T: Send,
impl<T> Sync for Request<T>where
T: Sync,
impl<T> Unpin for Request<T>where
T: Unpin,
impl<T> !UnwindSafe for Request<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
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