Struct ansi_control_codes::ControlFunction
source · 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<'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§fn eq(&self, other: &ControlFunction<'_>) -> bool
fn eq(&self, other: &ControlFunction<'_>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialEq<ControlFunction<'a>> for String
impl<'a> PartialEq<ControlFunction<'a>> for String
source§fn eq(&self, other: &ControlFunction<'_>) -> bool
fn eq(&self, other: &ControlFunction<'_>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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>
source§fn eq(&self, other: &ControlFunction<'a>) -> bool
fn eq(&self, other: &ControlFunction<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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