pub struct ControlFunction<'a> { /* private fields */ }
Expand description
An ansi control function defined in ECMA-48.
This struct implements the PartialEq
trait for String-like types (all types that implement AsRef<str>
).
It can be used to compare ControlFunctions with string-like values using ==
or !=
functions.
Example:
use ansi_control_codes::c0;
let some_string = String::from("\u{001B}");
if (c0::ESC == some_string) {
println!("ESC!")
}
Implementations§
Source§impl<'a> ControlFunction<'a>
impl<'a> ControlFunction<'a>
Sourcepub fn private_use(
value: &'a str,
parameters: Vec<String>,
) -> Result<Self, InvalidControlFunction>
pub fn private_use( value: &'a str, parameters: Vec<String>, ) -> Result<Self, InvalidControlFunction>
Creates a new control function representing a control sequence that is declared as private use.
These functions are not standardized and their function is unknown. Yet, the standard allows these functions to exist for experimental use.
If the specified value lies outside of the valid private use area, this function will return Err.
Trait Implementations§
Source§impl<'a> Debug for ControlFunction<'a>
impl<'a> Debug for ControlFunction<'a>
Source§impl<'a> Display for ControlFunction<'a>
impl<'a> Display for ControlFunction<'a>
Source§impl Explain for ControlFunction<'_>
impl Explain for ControlFunction<'_>
Source§fn short_name(&self) -> Option<&'static str>
fn short_name(&self) -> Option<&'static str>
Source§fn long_name(&self) -> &'static str
fn long_name(&self) -> &'static str
Returns the name of this control function, e.g.
Carriage Return
, Line Feed
.Source§fn short_description(&self) -> String
fn short_description(&self) -> String
Returns the short description of what this function does.
Source§fn long_description(&self) -> String
fn long_description(&self) -> String
Returns a long description of what this function does. Read more
Source§impl<'a> From<ControlFunction<'a>> for String
impl<'a> From<ControlFunction<'a>> for String
Source§fn from(control_function: ControlFunction<'_>) -> Self
fn from(control_function: ControlFunction<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq<ControlFunction<'a>> for &str
impl<'a> PartialEq<ControlFunction<'a>> for &str
Source§impl<'a> PartialEq<ControlFunction<'a>> for String
impl<'a> PartialEq<ControlFunction<'a>> for String
Source§impl<'a, T> PartialEq<T> for ControlFunction<'a>
impl<'a, T> PartialEq<T> for ControlFunction<'a>
Source§impl<'a> PartialEq for ControlFunction<'a>
impl<'a> PartialEq for ControlFunction<'a>
impl<'a> Eq for ControlFunction<'a>
impl<'a> StructuralPartialEq for ControlFunction<'a>
Auto Trait Implementations§
impl<'a> Freeze for ControlFunction<'a>
impl<'a> RefUnwindSafe for ControlFunction<'a>
impl<'a> Send for ControlFunction<'a>
impl<'a> Sync for ControlFunction<'a>
impl<'a> Unpin for ControlFunction<'a>
impl<'a> UnwindSafe for ControlFunction<'a>
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