pub struct FileConfig {
pub path: String,
pub delimiter: Option<String>,
pub mode: Option<FileConsumerMode>,
pub format: FileFormat,
}Fields§
§path: StringPath to the file.
delimiter: Option<String>Optional delimiter for messages. Defaults to newline (“\n”). Can be a string or a hex sequence (e.g. “0x00”). Currently only single-byte delimiters are supported.
mode: Option<FileConsumerMode>The consumption mode. If not specified, defaults to consume.
For publishers, this setting is ignored.
format: FileFormatThe format for writing messages to the file (Publisher) or interpreting them (Consumer). Defaults to normal.
Implementations§
Source§impl FileConfig
impl FileConfig
Sourcepub fn new(path: impl Into<String>) -> Self
pub fn new(path: impl Into<String>) -> Self
Creates a new File configuration with the specified path.
pub fn with_mode(self, mode: FileConsumerMode) -> Self
Sourcepub fn effective_mode(&self) -> FileConsumerMode
pub fn effective_mode(&self) -> FileConsumerMode
Returns the effective consumer mode, defaulting to Consume if not set.
Trait Implementations§
Source§impl Clone for FileConfig
impl Clone for FileConfig
Source§fn clone(&self) -> FileConfig
fn clone(&self) -> FileConfig
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 FileConfig
impl Debug for FileConfig
Source§impl Default for FileConfig
impl Default for FileConfig
Source§fn default() -> FileConfig
fn default() -> FileConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FileConfig
impl<'de> Deserialize<'de> for FileConfig
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 FileConfig
impl RefUnwindSafe for FileConfig
impl Send for FileConfig
impl Sync for FileConfig
impl Unpin for FileConfig
impl UnsafeUnpin for FileConfig
impl UnwindSafe for FileConfig
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