pub struct Tokenizer {Show 13 fields
pub typ: Option<u8>,
pub kin: Option<u8>,
pub num: f64,
pub field: TokenValueField,
pub value_kind: TokenValueKind,
pub value_start: usize,
pub value_end: usize,
pub src_id: Option<u32>,
pub sta: Option<usize>,
pub end: Option<usize>,
pub bytes_in: Option<usize>,
pub slice: Option<usize>,
pub parse_info: ParseInfo,
/* private fields */
}Expand description
tokenizer
Fields§
§typ: Option<u8>§kin: Option<u8>§num: f64§field: TokenValueField§value_kind: TokenValueKind§value_start: usize§value_end: usize§src_id: Option<u32>§sta: Option<usize>§end: Option<usize>§bytes_in: Option<usize>§slice: Option<usize>§parse_info: ParseInfoImplementations§
Source§impl Tokenizer
impl Tokenizer
pub fn new(parse_info: ParseInfo) -> Self
Sourcepub fn from_input(input: &CssInput) -> Self
pub fn from_input(input: &CssInput) -> Self
tokenizer of a css input with a new anonymous source
Sourcepub fn load(parse_info: &mut ParseInfo, input: Option<&CssInput>)
pub fn load(parse_info: &mut ParseInfo, input: Option<&CssInput>)
set the css read by the tokenizer. the text of the css is the content of the source file
Sourcepub fn stream_length(&self) -> usize
pub fn stream_length(&self) -> usize
length of the css input, in code units
Sourcepub fn source(&self) -> Rc<SourceFile>
pub fn source(&self) -> Rc<SourceFile>
the source file
Sourcepub fn make_token(
&mut self,
hint: Option<u8>,
slice: Option<usize>,
decode_segments: bool,
) -> &mut Self
pub fn make_token( &mut self, hint: Option<u8>, slice: Option<usize>, decode_segments: bool, ) -> &mut Self
set the current token: its type, its numeric value and the range of its string value. no string is created
Sourcepub fn intern_value(&mut self, arena: &AstArena, source_index: i32) -> u32
pub fn intern_value(&mut self, arena: &AstArena, source_index: i32) -> u32
id of the string value of the current token in the arena. no string is created
Sourcepub fn value_string(&mut self) -> String
pub fn value_string(&mut self) -> String
the string value of the current token (decoded)
pub fn done(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for Tokenizer
impl !Send for Tokenizer
impl !Sync for Tokenizer
impl !UnwindSafe for Tokenizer
impl Forget for Tokenizer
impl Freeze for Tokenizer
impl Move for Tokenizer
impl Unpin for Tokenizer
impl UnsafeUnpin for Tokenizer
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