pub struct ChunkList<const MTU: usize>(/* private fields */);
Expand description

List of Chunk, simply wrapped Vec<Chunk>

Implementations§

source§

impl<const MTU: usize> ChunkList<MTU>

source

pub fn to_vec(&self) -> Vec<Chunk, Global>

ChunkList to Vec

source

pub fn as_vec(&self) -> &Vec<Chunk, Global>

ChunkList to &Vec

source

pub fn as_vec_mut(&mut self) -> &mut Vec<Chunk, Global>

ChunkList to &mut Vec

source

pub fn formalize(&self) -> ChunkList<MTU>

dedup and sort elements in list

source

pub fn search(&self, id: Uuid) -> ChunkList<MTU>

search and formalize

source

pub fn is_completed(&self) -> bool

check list that is completed

source

pub fn try_withdraw(&self) -> Option<Bytes>

if list is completed, withdraw data, or return None

Trait Implementations§

source§

impl<const MTU: usize> ChunkManager for ChunkList<MTU>

source§

fn list_completed(&self) -> Vec<Uuid, Global>

list completed Chunks;
source§

fn list_pending(&self) -> Vec<Uuid, Global>

list pending Chunks;
source§

fn get(&self, id: Uuid) -> Option<Bytes>

get sepc msg via uuid if a msg is not completed, it will returns None
source§

fn remove(&mut self, id: Uuid)

remove all chunks of id
source§

fn remove_expired(&mut self)

remove expired chunks by ttl
source§

fn handle(&mut self, chunk: Chunk) -> Option<Bytes>

handle a chunk
source§

impl<const MTU: usize> Clone for ChunkList<MTU>

source§

fn clone(&self) -> ChunkList<MTU>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const MTU: usize> Debug for ChunkList<MTU>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<const MTU: usize> Default for ChunkList<MTU>

source§

fn default() -> ChunkList<MTU>

Returns the “default value” for a type. Read more
source§

impl<'de, const MTU: usize> Deserialize<'de> for ChunkList<MTU>

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<ChunkList<MTU>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<const MTU: usize> From<&Bytes> for ChunkList<MTU>

source§

fn from(bytes: &Bytes) -> ChunkList<MTU>

Converts to this type from the input type.
source§

impl<const MTU: usize> From<Vec<Chunk, Global>> for ChunkList<MTU>

source§

fn from(data: Vec<Chunk, Global>) -> ChunkList<MTU>

Converts to this type from the input type.
source§

impl<const MTU: usize> IntoIterator for &ChunkList<MTU>

§

type Item = Chunk

The type of the elements being iterated over.
§

type IntoIter = IntoIter<Chunk, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&ChunkList<MTU> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<const MTU: usize> IntoIterator for ChunkList<MTU>

§

type Item = Chunk

The type of the elements being iterated over.
§

type IntoIter = IntoIter<Chunk, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <ChunkList<MTU> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<const MTU: usize> Serialize for ChunkList<MTU>

source§

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

Auto Trait Implementations§

§

impl<const MTU: usize> RefUnwindSafe for ChunkList<MTU>

§

impl<const MTU: usize> Send for ChunkList<MTU>

§

impl<const MTU: usize> Sync for ChunkList<MTU>

§

impl<const MTU: usize> Unpin for ChunkList<MTU>

§

impl<const MTU: usize> UnwindSafe for ChunkList<MTU>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for Twhere T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,

§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
§

fn upcast_any_box(self: Box<T, Global>) -> Box<dyn Any, Global>

upcast boxed dyn
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,