[][src]Struct hdbconnect::types::CharLobSlice

pub struct CharLobSlice {
    pub prefix: Option<Vec<u8>>,
    pub data: String,
    pub postfix: Option<Vec<u8>>,
}

Return value when reading a slice with CLob::read_slice() or NCLob::read_slice().

Both methods allow specifying the offset and the length of the requested slice.

  • CLob::read_slice() interprets offset and length as numbers of bytes, applied to the HANA-internally used CESU8-encoding, where a unicode codepoint needs between 1 and 6 bytes.

    If the specified boundaries of the slice do not coincide with the begin or end of a unicode-codepoint, then it will begin and/or end with a byte sequence that cannot be converted into UTF-8, the unicode-encoding used by rust's String. CharLobSlice::prefix and/or CharLobSlice::postfix then contain these 1-5 extra bytes.

  • NCLob::read_slice() interprets offset and length as numbers of unicode characters, where the following rule is applied:

    • a unicode codepoint in BMP-0 (which is represented as 1, 2, or 3 bytes) counts as 1

    • a unicode codepoint in BMP-1 (which is represented as a pair of two surrogates, each of which is a 3-byte sequence) counts as 2.

    If the specified boundaries of the slice do not coincide with the begin or end of a unicode-codepoint, i.e. if the slice begins with a second surrogate or ends with a first surrogate, then CharLobSlice::prefix and/or CharLobSlice::postfix will contain these 3 extra bytes.

Fields

prefix: Option<Vec<u8>>

If relevant, contains bytes at the begin of the slice from an incomplete unicode-codepoint.

data: String

The main part of the slice.

postfix: Option<Vec<u8>>

If relevant, contains bytes at the end of the slice from an incomplete unicode-codepoint.

Trait Implementations

impl Clone for CharLobSlice[src]

impl Debug for CharLobSlice[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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