pub struct AlwaysDispatcher(pub CodecKind);Expand description
常に同じ kind を返す dispatcher (固定 codec 運用)。
Tuple Fields§
§0: CodecKindTrait Implementations§
Source§impl Clone for AlwaysDispatcher
impl Clone for AlwaysDispatcher
Source§fn clone(&self) -> AlwaysDispatcher
fn clone(&self) -> AlwaysDispatcher
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 moreSource§impl CodecDispatcher for AlwaysDispatcher
impl CodecDispatcher for AlwaysDispatcher
fn pick<'life0, 'life1, 'async_trait>(
&'life0 self,
_sample: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CodecKind> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn pick_with_size_hint<'life0, 'life1, 'async_trait>(
&'life0 self,
sample: &'life1 [u8],
_total_size: Option<u64>,
) -> Pin<Box<dyn Future<Output = CodecKind> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pick_with_size_hint<'life0, 'life1, 'async_trait>(
&'life0 self,
sample: &'life1 [u8],
_total_size: Option<u64>,
) -> Pin<Box<dyn Future<Output = CodecKind> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
v0.8 #56: size-hint aware pick. 既定実装は
pick(sample) に委譲する
ので、追加情報を活用する dispatcher (SamplingDispatcher) のみ override
すればよい。total_size = None は「chunked transfer で content-length
が無い」ケースを表す。Source§impl Debug for AlwaysDispatcher
impl Debug for AlwaysDispatcher
impl Copy for AlwaysDispatcher
Auto Trait Implementations§
impl Freeze for AlwaysDispatcher
impl RefUnwindSafe for AlwaysDispatcher
impl Send for AlwaysDispatcher
impl Sync for AlwaysDispatcher
impl Unpin for AlwaysDispatcher
impl UnsafeUnpin for AlwaysDispatcher
impl UnwindSafe for AlwaysDispatcher
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