MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / with_config

Method with_config

atomic-core/src/diff/token/tokenizer.rs:85–91  ·  view source on GitHub ↗

Create a new tokenizer with custom configuration. # Arguments `content` - The bytes to tokenize `config` - The tokenization configuration # Example ```rust use atomic_core::diff::token::{Tokenizer, TokenizerConfig}; let config = TokenizerConfig::minimal(); let tokenizer = Tokenizer::with_config(b"x = 42", config); let tokens: Vec<_> = tokenizer.collect(); ```

(content: &'a [u8], config: TokenizerConfig)

Source from the content-addressed store, hash-verified

83 /// let tokens: Vec<_> = tokenizer.collect();
84 /// ```
85 pub fn with_config(content: &'a [u8], config: TokenizerConfig) -> Self {
86 Self {
87 content,
88 position: 0,
89 config,
90 }
91 }
92
93 /// Tokenize all content and return as a vector.
94 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected