pub struct CodeSetComponent {
pub native_code_set: u32,
pub conversion_code_sets: Vec<u32>,
}Expand description
Code-set component (spec §13.10.2.4).
Fields§
§native_code_set: u32Native code set (e.g. 0x00010001 = ISO-8859-1).
conversion_code_sets: Vec<u32>Conversion code sets — we hold the list header (count); the full content is at the caller. CodeSetComponentInfo models that fully.
Implementations§
Source§impl CodeSetComponent
impl CodeSetComponent
Sourcepub fn negotiate(&self, server: &CodeSetComponent, fallback: u32) -> Option<u32>
pub fn negotiate(&self, server: &CodeSetComponent, fallback: u32) -> Option<u32>
Selects the transmission codeset between client and server for one codeset axis (char OR wchar), per the algorithm from spec §13.10.2.6:
- Native match → native (no conversion).
- Server-native ∈ client conversion → server-native (client converts).
- Client-native ∈ server conversion → client-native (server converts).
- Common conversion codeset → that one.
fallback(e.g. UTF-8/UTF-16) supported by both →fallback.- otherwise incompatible →
None(caller throwsCODESET_INCOMPATIBLE).
self = client component, server = server component (from its IOR).
Trait Implementations§
Source§impl Clone for CodeSetComponent
impl Clone for CodeSetComponent
Source§fn clone(&self) -> CodeSetComponent
fn clone(&self) -> CodeSetComponent
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 Debug for CodeSetComponent
impl Debug for CodeSetComponent
impl Eq for CodeSetComponent
Source§impl PartialEq for CodeSetComponent
impl PartialEq for CodeSetComponent
Source§fn eq(&self, other: &CodeSetComponent) -> bool
fn eq(&self, other: &CodeSetComponent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CodeSetComponent
Auto Trait Implementations§
impl Freeze for CodeSetComponent
impl RefUnwindSafe for CodeSetComponent
impl Send for CodeSetComponent
impl Sync for CodeSetComponent
impl Unpin for CodeSetComponent
impl UnsafeUnpin for CodeSetComponent
impl UnwindSafe for CodeSetComponent
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