pub struct CompressionCaps {
pub algorithms: Vec<Algorithm>,
pub max_payload: usize,
pub streaming: bool,
pub ml_routing: bool,
pub encodings: Vec<Encoding>,
pub preferred_encoding: Encoding,
}Expand description
Compression-related capabilities
Fields§
§algorithms: Vec<Algorithm>Supported algorithms in preference order
max_payload: usizeMaximum payload size in bytes (0 = unlimited)
streaming: boolSupports streaming compression
ml_routing: boolHas ML routing capability
encodings: Vec<Encoding>Supported tokenizer encodings (for TokenNative)
preferred_encoding: EncodingPreferred tokenizer encoding
Implementations§
Source§impl CompressionCaps
impl CompressionCaps
Sourcepub fn with_ml_routing(self) -> Self
pub fn with_ml_routing(self) -> Self
Create with ML routing enabled
Sourcepub fn with_algorithms(self, algorithms: Vec<Algorithm>) -> Self
pub fn with_algorithms(self, algorithms: Vec<Algorithm>) -> Self
Create with specific algorithms
Sourcepub fn with_encodings(self, encodings: Vec<Encoding>) -> Self
pub fn with_encodings(self, encodings: Vec<Encoding>) -> Self
Create with specific encodings
Sourcepub fn with_preferred_encoding(self, encoding: Encoding) -> Self
pub fn with_preferred_encoding(self, encoding: Encoding) -> Self
Set preferred encoding
Sourcepub fn supports_encoding(&self, encoding: Encoding) -> bool
pub fn supports_encoding(&self, encoding: Encoding) -> bool
Check if encoding is supported
Sourcepub fn negotiate(&self, other: &CompressionCaps) -> Option<Algorithm>
pub fn negotiate(&self, other: &CompressionCaps) -> Option<Algorithm>
Get best mutually supported algorithm
Sourcepub fn negotiate_encoding(&self, other: &CompressionCaps) -> Encoding
pub fn negotiate_encoding(&self, other: &CompressionCaps) -> Encoding
Negotiate tokenizer encoding
Trait Implementations§
Source§impl Clone for CompressionCaps
impl Clone for CompressionCaps
Source§fn clone(&self) -> CompressionCaps
fn clone(&self) -> CompressionCaps
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompressionCaps
impl Debug for CompressionCaps
Source§impl Default for CompressionCaps
impl Default for CompressionCaps
Source§impl<'de> Deserialize<'de> for CompressionCaps
impl<'de> Deserialize<'de> for CompressionCaps
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
Auto Trait Implementations§
impl Freeze for CompressionCaps
impl RefUnwindSafe for CompressionCaps
impl Send for CompressionCaps
impl Sync for CompressionCaps
impl Unpin for CompressionCaps
impl UnwindSafe for CompressionCaps
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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