pub struct WrapperJWT {
pub token: String,
pub secret: String,
pub items: Option<Value>,
pub exp: usize,
}
Fields§
§token: String
§secret: String
§items: Option<Value>
§exp: usize
Implementations§
Source§impl WrapperJWT
impl WrapperJWT
pub fn get_mut_token(&mut self) -> &mut String
pub fn get_mut_secret(&mut self) -> &mut String
pub fn get_mut_items(&mut self) -> &mut Option<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>( token: String, secret: String, items: Option<Value>, exp: usize, ) -> Self
Sourcepub fn get_token(&self) -> &String
pub fn get_token(&self) -> &String
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_secret(&self) -> &String
pub fn get_secret(&self) -> &String
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_items(&self) -> &Option<Value>
pub fn get_items(&self) -> &Option<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_token<T: Into<String>>(&mut self, new: T)
pub fn set_token<T: Into<String>>(&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_secret<T: Into<String>>(&mut self, new: T)
pub fn set_secret<T: Into<String>>(&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_items<T: Into<Option<Value>>>(&mut self, new: T)
pub fn set_items<T: Into<Option<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_token(&self)
pub fn print_success_token(&self)
Print the value of the {field_name}
field with a ‘SUCCESS’ label and light yellow color-coded output.
Sourcepub fn print_success_secret(&self)
pub fn print_success_secret(&self)
Print the value of the {field_name}
field with a ‘SUCCESS’ 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_token(&self)
pub fn print_token(&self)
Print the value of the {field_name}
field with a default label and light yellow color-coded output.
Sourcepub fn print_secret(&self)
pub fn print_secret(&self)
Print the value of the {field_name}
field with a default 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_token(&self)
pub fn print_rust_token(&self)
Print the value of the {field_name}
field with a ‘RUST’ label and light yellow color-coded output.
Sourcepub fn print_rust_secret(&self)
pub fn print_rust_secret(&self)
Print the value of the {field_name}
field with a ‘RUST’ 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_token(&self)
pub fn print_info_token(&self)
Print the value of the {field_name}
field with a ‘INFO’ label and light yellow color-coded output.
Sourcepub fn print_info_secret(&self)
pub fn print_info_secret(&self)
Print the value of the {field_name}
field with a ‘INFO’ 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_token(&self)
pub fn print_warning_token(&self)
Print the value of the {field_name}
field with a ‘WARNING’ label and light yellow color-coded output.
Sourcepub fn print_warning_secret(&self)
pub fn print_warning_secret(&self)
Print the value of the {field_name}
field with a ‘WARNING’ 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_token(&self)
pub fn print_err_token(&self)
Print the value of the {field_name}
field with a ‘ERR’ label and light yellow color-coded output.
Sourcepub fn print_err_secret(&self)
pub fn print_err_secret(&self)
Print the value of the {field_name}
field with a ‘ERR’ 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.
Trait Implementations§
Source§impl Clone for WrapperJWT
impl Clone for WrapperJWT
Source§fn clone(&self) -> WrapperJWT
fn clone(&self) -> WrapperJWT
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more