pub struct TelegramConfig {
pub streaming: bool,
pub buffer_size: usize,
pub max_message_size: usize,
pub skip_invalid: bool,
}Expand description
Configuration for Telegram export parsing.
Telegram exports are JSON files with a messages array. This config
controls how the parser handles large files and invalid data.
§Example
use chatpack::config::TelegramConfig;
let config = TelegramConfig::new()
.with_streaming(true)
.with_skip_invalid(true);Fields§
§streaming: boolEnable streaming mode for large files (default: false)
buffer_size: usizeBuffer size for streaming (default: 64KB)
max_message_size: usizeMaximum message size in bytes (default: 10MB)
skip_invalid: boolSkip invalid messages instead of returning errors (default: true)
Implementations§
Source§impl TelegramConfig
impl TelegramConfig
Sourcepub fn with_streaming(self, enabled: bool) -> Self
pub fn with_streaming(self, enabled: bool) -> Self
Enables or disables streaming mode.
Sourcepub fn with_buffer_size(self, size: usize) -> Self
pub fn with_buffer_size(self, size: usize) -> Self
Sets the buffer size for streaming.
Sourcepub fn with_max_message_size(self, size: usize) -> Self
pub fn with_max_message_size(self, size: usize) -> Self
Sets the maximum message size.
Sourcepub fn with_skip_invalid(self, skip: bool) -> Self
pub fn with_skip_invalid(self, skip: bool) -> Self
Sets whether to skip invalid messages.
Trait Implementations§
Source§impl Clone for TelegramConfig
impl Clone for TelegramConfig
Source§fn clone(&self) -> TelegramConfig
fn clone(&self) -> TelegramConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 TelegramConfig
impl Debug for TelegramConfig
Source§impl Default for TelegramConfig
impl Default for TelegramConfig
Source§impl<'de> Deserialize<'de> for TelegramConfig
impl<'de> Deserialize<'de> for TelegramConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TelegramConfig
impl RefUnwindSafe for TelegramConfig
impl Send for TelegramConfig
impl Sync for TelegramConfig
impl Unpin for TelegramConfig
impl UnwindSafe for TelegramConfig
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