#[repr(u8)]pub enum TextEncoding {
Utf8 = 1,
Utf16le = 2,
Utf16be = 3,
}Expand description
Encoding used for text in the database.
Variants§
Utf8 = 1
UTF-8 encoding (the most common).
Utf16le = 2
UTF-16le (little-endian).
Utf16be = 3
UTF-16be (big-endian).
Implementations§
Source§impl TextEncoding
impl TextEncoding
Sourcepub const fn is_runtime_supported(self) -> bool
pub const fn is_runtime_supported(self) -> bool
Whether the v0.2 runtime can safely interpret and write this encoding.
Header parsing remains format-complete for all three SQLite encoding values so callers can distinguish valid-but-unsupported databases from malformed headers. Runtime admission is deliberately narrower until the value and collation layers preserve UTF-16 text bytes end to end.
Sourcepub const fn is_read_supported(self) -> bool
pub const fn is_read_supported(self) -> bool
Whether this encoding is supported for READ-ONLY access (bd-bld9w.3).
UTF-8 plus UTF-16LE/BE: the record-decode layer decodes UTF-16 TEXT to
canonical UTF-8 end to end, so reading a UTF-16 database is safe. Writing
one is NOT yet supported (the record-encode path is not wired into
MakeRecord), so callers must still reject mutations on a database whose
encoding is not Self::is_runtime_supported.
Sourcepub const fn is_write_supported(self) -> bool
pub const fn is_write_supported(self) -> bool
Whether this encoding is supported for READ-WRITE access (bd-bld9w.7).
UTF-8 plus UTF-16LE/BE: every on-disk write-serialization path now encodes
TEXT in the database’s text encoding (the bd-bld9w.7 write-encode sweep), so
writing a UTF-16 database is byte-correct end to end. Mutation admission is
gated on this rather than the narrower Self::is_runtime_supported, which
remains for callers that specifically need the UTF-8-only predicate.
Trait Implementations§
Source§impl Clone for TextEncoding
impl Clone for TextEncoding
Source§fn clone(&self) -> TextEncoding
fn clone(&self) -> TextEncoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TextEncoding
Source§impl Debug for TextEncoding
impl Debug for TextEncoding
Source§impl Default for TextEncoding
impl Default for TextEncoding
Source§fn default() -> TextEncoding
fn default() -> TextEncoding
impl Eq for TextEncoding
Source§impl Hash for TextEncoding
impl Hash for TextEncoding
Source§impl PartialEq for TextEncoding
impl PartialEq for TextEncoding
impl StructuralPartialEq for TextEncoding
Auto Trait Implementations§
impl Freeze for TextEncoding
impl RefUnwindSafe for TextEncoding
impl Send for TextEncoding
impl Sync for TextEncoding
impl Unpin for TextEncoding
impl UnsafeUnpin for TextEncoding
impl UnwindSafe for TextEncoding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.