Struct rphtml::entity::Entity[][src]

pub struct Entity {
    pub entity_in: Option<EntityIn>,
    pub characters: Vec<char, Global>,
    pub is_end: bool,
}

Entity struct

Fields

entity_in: Option<EntityIn>characters: Vec<char, Global>is_end: bool

Implementations

impl Entity[src]

pub fn new() -> Entity[src]

Return an Entity struct, same as Entity::default()

pub fn add(&mut self, ch: char) -> bool[src]

add(ch: char): check if the character is an allowed character

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

decode(): decode the entity, if ok, return the unicode character.

pub fn get_chars(&self) -> Vec<char, Global>

Notable traits for Vec<u8, Global>

impl Write for Vec<u8, Global>
[src]

get_chars() return the characters of the entity,if it’s a correct entity, it will return the Vec with the decoded unicode character, otherwise return all the characters.

Trait Implementations

impl Default for Entity[src]

Auto Trait Implementations

impl RefUnwindSafe for Entity

impl Send for Entity

impl Sync for Entity

impl Unpin for Entity

impl UnwindSafe for Entity

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.