pub struct DiscordConfig {
pub streaming: bool,
pub buffer_size: usize,
pub max_message_size: usize,
pub prefer_nickname: bool,
pub include_attachments: bool,
pub skip_invalid: bool,
}Expand description
Configuration for Discord export parsing.
Discord exports can be in JSON, TXT, or CSV format (from DiscordChatExporter). The parser auto-detects the format from file extension or content.
§Example
use chatpack::config::DiscordConfig;
let config = DiscordConfig::new()
.with_prefer_nickname(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)
prefer_nickname: boolPrefer nickname over username when available (default: true)
include_attachments: boolInclude attachment/sticker information (default: true)
skip_invalid: boolSkip invalid messages instead of returning errors (default: true)
Implementations§
Source§impl DiscordConfig
impl DiscordConfig
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_prefer_nickname(self, prefer: bool) -> Self
pub fn with_prefer_nickname(self, prefer: bool) -> Self
Sets whether to prefer nickname over username.
Sourcepub fn with_include_attachments(self, include: bool) -> Self
pub fn with_include_attachments(self, include: bool) -> Self
Sets whether to include attachments in message content.
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 DiscordConfig
impl Clone for DiscordConfig
Source§fn clone(&self) -> DiscordConfig
fn clone(&self) -> DiscordConfig
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 DiscordConfig
impl Debug for DiscordConfig
Source§impl Default for DiscordConfig
impl Default for DiscordConfig
Source§impl<'de> Deserialize<'de> for DiscordConfig
impl<'de> Deserialize<'de> for DiscordConfig
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 DiscordConfig
impl RefUnwindSafe for DiscordConfig
impl Send for DiscordConfig
impl Sync for DiscordConfig
impl Unpin for DiscordConfig
impl UnwindSafe for DiscordConfig
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