[][src]Enum rtf_grimoire::tokenizer::Token

pub enum Token {
    ControlSymbol(char),
    ControlWord {
        name: String,
        arg: Option<i32>,
    },
    ControlBin(Vec<u8>),
    Text(Vec<u8>),
    StartGroup,
    EndGroup,
    Newline,
}

Variants

ControlSymbol(char)ControlWord

Fields of ControlWord

name: Stringarg: Option<i32>
ControlBin(Vec<u8>)Text(Vec<u8>)

Text is not str because it can be in any of various encodings - it's up to the processor to identify any encoding information in the stream, and do any encoding conversion desired

StartGroupEndGroupNewline

Methods

impl Token[src]

pub fn to_rtf(&self) -> Vec<u8>[src]

pub fn token_delimiter_after(&self, next_token: &Token) -> &'static str[src]

This function returns a control word delimiter if one is required, or an empty string if none is required

Control Word tokens must be delimited by a non-alphanumeric value, so if the subsequent content could be alphanumeric, a space (' ') delimiter must be inserted

pub fn token_delimiter_before(&self, prev_token: &Token) -> &'static str[src]

This function returns a control word delimiter if one is required, or an empty string if none is required

Control Word tokens must be delimited by a non-alphanumeric value, so if the subsequent content could be alphanumeric, a space (' ') delimiter must be inserted

pub fn get_name(&self) -> Option<String>[src]

pub fn get_arg(&self) -> Option<i32>[src]

pub fn get_symbol(&self) -> Option<char>[src]

pub fn get_bin(&self) -> Option<&[u8]>[src]

pub fn get_text(&self) -> Option<&[u8]>[src]

Trait Implementations

impl PartialEq<Token> for Token[src]

impl Debug for Token[src]

Auto Trait Implementations

impl Send for Token

impl Sync for Token

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.