Skip to main content

AutoEncodingReaderBuilder

Struct AutoEncodingReaderBuilder 

Source
pub struct AutoEncodingReaderBuilder<R> { /* private fields */ }
Expand description

构建器,用于配置 AutoEncodingReader

Implementations§

Source§

impl<R: Read> AutoEncodingReaderBuilder<R>

Source

pub fn with_reader(reader: R) -> Self

创建新的构建器

Source

pub fn fallbacks(self, fallbacks: &[&'static Encoding]) -> Self

设置后备编码列表

Source

pub fn detect_buffer_size(self, size: usize) -> Self

设置检测缓冲区大小(字节数)

Source

pub fn read_buffer_size(self, size: usize) -> Self

设置后续读取缓冲区大小(字节数)

Source

pub fn language_weight(self, language: &str, weight: f32) -> Self

添加语言权重(可多次调用)

Source

pub fn default_weight(self, weight: f32) -> Self

设置默认权重

Source

pub fn build(self) -> Result<AutoEncodingReader<R>, EncodingError>

构建 AutoEncodingReader

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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.

Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.