pub struct Token {
pub items: Value,
pub exp: usize,
}
Fields§
§items: Value
§exp: usize
Implementations§
Source§impl Token
impl Token
pub fn get_mut_items(&mut self) -> &mut Value
pub fn get_mut_exp(&mut self) -> &mut usize
pub fn from_json(json_value: Value) -> Result<Self, String>
pub fn to_json(&self) -> Value
pub fn new<'a>(items: Value, exp: usize) -> Self
Sourcepub fn get_items(&self) -> &Value
pub fn get_items(&self) -> &Value
Get an immutable reference to the {field_name}
field of the struct.
This method allows you to obtain an immutable reference to the {field_name}
field of the struct, which you can use to access its value.
§Returns
An immutable reference to the {field_name}
field.
Sourcepub fn get_exp(&self) -> &usize
pub fn get_exp(&self) -> &usize
Get an immutable reference to the {field_name}
field of the struct.
This method allows you to obtain an immutable reference to the {field_name}
field of the struct, which you can use to access its value.
§Returns
An immutable reference to the {field_name}
field.
Sourcepub fn set_items<T: Into<Value>>(&mut self, new: T)
pub fn set_items<T: Into<Value>>(&mut self, new: T)
Set the value of the {field_name}
field of the struct.
This method allows you to update the value of the {field_name}
field of the struct.
§Arguments
new
: A value of type that can be converted into{field_name}
’s type.
Sourcepub fn set_exp<T: Into<usize>>(&mut self, new: T)
pub fn set_exp<T: Into<usize>>(&mut self, new: T)
Set the value of the {field_name}
field of the struct.
This method allows you to update the value of the {field_name}
field of the struct.
§Arguments
new
: A value of type that can be converted into{field_name}
’s type.
Sourcepub fn print_all_levels(&self)
pub fn print_all_levels(&self)
Print the struct with various labels and color-coded output.
Sourcepub fn print_rust(&self)
pub fn print_rust(&self)
Print the struct with a ‘RUST’ label and dark red color-coded output.
Sourcepub fn print_info(&self)
pub fn print_info(&self)
Print the struct with an ‘INFO’ label and purple color-coded output.
Sourcepub fn print_success(&self)
pub fn print_success(&self)
Print the struct with a ‘SUCCESS’ label and light green color-coded output.
Sourcepub fn print_warning(&self)
pub fn print_warning(&self)
Print the struct with a ‘WARNING’ label and light yellow color-coded output.
Sourcepub fn print_success_items(&self)
pub fn print_success_items(&self)
Print the value of the {field_name}
field with a ‘SUCCESS’ label and light yellow color-coded output.
Sourcepub fn print_success_exp(&self)
pub fn print_success_exp(&self)
Print the value of the {field_name}
field with a ‘SUCCESS’ label and light yellow color-coded output.
Sourcepub fn print_items(&self)
pub fn print_items(&self)
Print the value of the {field_name}
field with a default label and light yellow color-coded output.
Sourcepub fn print_exp(&self)
pub fn print_exp(&self)
Print the value of the {field_name}
field with a default label and light yellow color-coded output.
Sourcepub fn print_rust_items(&self)
pub fn print_rust_items(&self)
Print the value of the {field_name}
field with a ‘RUST’ label and light yellow color-coded output.
Sourcepub fn print_rust_exp(&self)
pub fn print_rust_exp(&self)
Print the value of the {field_name}
field with a ‘RUST’ label and light yellow color-coded output.
Sourcepub fn print_info_items(&self)
pub fn print_info_items(&self)
Print the value of the {field_name}
field with a ‘INFO’ label and light yellow color-coded output.
Sourcepub fn print_info_exp(&self)
pub fn print_info_exp(&self)
Print the value of the {field_name}
field with a ‘INFO’ label and light yellow color-coded output.
Sourcepub fn print_warning_items(&self)
pub fn print_warning_items(&self)
Print the value of the {field_name}
field with a ‘WARNING’ label and light yellow color-coded output.
Sourcepub fn print_warning_exp(&self)
pub fn print_warning_exp(&self)
Print the value of the {field_name}
field with a ‘WARNING’ label and light yellow color-coded output.
Sourcepub fn print_err_items(&self)
pub fn print_err_items(&self)
Print the value of the {field_name}
field with a ‘ERR’ label and light yellow color-coded output.
Sourcepub fn print_err_exp(&self)
pub fn print_err_exp(&self)
Print the value of the {field_name}
field with a ‘ERR’ label and light yellow color-coded output.