pub struct ScanOptions {
pub policy: Policy,
pub dialect: Dialect,
pub force_invalid: bool,
pub force_protected: bool,
pub keep_kinds: Vec<CommentKind>,
pub remove_kinds: Vec<CommentKind>,
pub keep_regex: Vec<String>,
pub remove_regex: Vec<String>,
}Expand description
Everything that decides what a scan finds and what it does with it.
Self::default is the Policy::Safe policy with no overrides.
Fields§
§policy: PolicyWhich kinds survive by default.
dialect: DialectThe vendor rules to lex with. It must be one the language supports.
force_invalid: boolEdit even a source the scanner reported invalid. Without it a file with an unterminated comment or string comes back byte for byte.
force_protected: boolRemove the shebang and encoding preamble as well. Nothing else protects them.
keep_kinds: Vec<CommentKind>Kinds kept whatever the policy says. Tested before everything else.
remove_kinds: Vec<CommentKind>Kinds removed unless a keep rule claimed them first.
keep_regex: Vec<String>Byte-regexes that protect matching complete comment tokens.
remove_regex: Vec<String>Byte-regexes that remove matching complete comment tokens.
Trait Implementations§
Source§impl Clone for ScanOptions
impl Clone for ScanOptions
Source§fn clone(&self) -> ScanOptions
fn clone(&self) -> ScanOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ScanOptions
impl Debug for ScanOptions
Source§impl Default for ScanOptions
impl Default for ScanOptions
Source§impl<'de> Deserialize<'de> for ScanOptionswhere
ScanOptions: Default,
impl<'de> Deserialize<'de> for ScanOptionswhere
ScanOptions: Default,
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
impl Eq for ScanOptions
Source§impl Hash for ScanOptions
impl Hash for ScanOptions
Source§impl PartialEq for ScanOptions
impl PartialEq for ScanOptions
Source§impl Serialize for ScanOptions
impl Serialize for ScanOptions
impl StructuralPartialEq for ScanOptions
Auto Trait Implementations§
impl Freeze for ScanOptions
impl RefUnwindSafe for ScanOptions
impl Send for ScanOptions
impl Sync for ScanOptions
impl Unpin for ScanOptions
impl UnsafeUnpin for ScanOptions
impl UnwindSafe for ScanOptions
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