pub struct FileValidationOptions {
pub max_len: usize,
pub allow_trailing_nul: bool,
}Expand description
Configuration for filename validation.
Fields§
§max_len: usizeMaximum filename length (default: 255)
allow_trailing_nul: boolAllow trailing NUL bytes (default: false)
When enabled, trailing NUL bytes are trimmed before validation. The effective filename is everything up to (but not including) the trailing NUL sequence. Embedded NULs (followed by non-NUL bytes) are still blocked.
This is useful for validating fixed-stride null-padded strings from memory-mapped files or binary formats.
Trait Implementations§
Source§impl Clone for FileValidationOptions
impl Clone for FileValidationOptions
Source§fn clone(&self) -> FileValidationOptions
fn clone(&self) -> FileValidationOptions
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 FileValidationOptions
impl Debug for FileValidationOptions
Auto Trait Implementations§
impl Freeze for FileValidationOptions
impl RefUnwindSafe for FileValidationOptions
impl Send for FileValidationOptions
impl Sync for FileValidationOptions
impl Unpin for FileValidationOptions
impl UnwindSafe for FileValidationOptions
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