pub struct AutoEncodingReaderBuilder<R> { /* private fields */ }Expand description
构建器,用于配置 AutoEncodingReader
Implementations§
Source§impl<R: Read> AutoEncodingReaderBuilder<R>
impl<R: Read> AutoEncodingReaderBuilder<R>
Sourcepub fn with_reader(reader: R) -> Self
pub fn with_reader(reader: R) -> Self
创建新的构建器
Sourcepub fn detect_buffer_size(self, size: usize) -> Self
pub fn detect_buffer_size(self, size: usize) -> Self
设置检测缓冲区大小(字节数)
Sourcepub fn read_buffer_size(self, size: usize) -> Self
pub fn read_buffer_size(self, size: usize) -> Self
设置后续读取缓冲区大小(字节数)
Sourcepub fn language_weight(self, language: &str, weight: f32) -> Self
pub fn language_weight(self, language: &str, weight: f32) -> Self
添加语言权重(可多次调用)
Sourcepub fn default_weight(self, weight: f32) -> Self
pub fn default_weight(self, weight: f32) -> Self
设置默认权重
Sourcepub fn build(self) -> Result<AutoEncodingReader<R>, EncodingError>
pub fn build(self) -> Result<AutoEncodingReader<R>, EncodingError>
构建 AutoEncodingReader
Auto Trait Implementations§
impl<R> Freeze for AutoEncodingReaderBuilder<R>where
R: Freeze,
impl<R> RefUnwindSafe for AutoEncodingReaderBuilder<R>where
R: RefUnwindSafe,
impl<R> Send for AutoEncodingReaderBuilder<R>where
R: Send,
impl<R> Sync for AutoEncodingReaderBuilder<R>where
R: Sync,
impl<R> Unpin for AutoEncodingReaderBuilder<R>where
R: Unpin,
impl<R> UnsafeUnpin for AutoEncodingReaderBuilder<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for AutoEncodingReaderBuilder<R>where
R: UnwindSafe,
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