pub enum CategoryCode {
Show 16 variants
Escape = 0,
BeginGroup = 1,
EndGroup = 2,
MathShift = 3,
AlignmentTab = 4,
EOL = 5,
Parameter = 6,
Superscript = 7,
Subscript = 8,
Ignored = 9,
Space = 10,
Letter = 11,
Other = 12,
Active = 13,
Comment = 14,
Invalid = 15,
}Expand description
The category code of a character.
To convert between CategoryCodes and their numerical values (as u8), use CategoryCode::try_from
and u8::from, respectively.
§Example
use tex_engine::tex::catcodes::CategoryCode;
let cat = CategoryCode::BeginGroup;
let num : u8 = cat.into();
assert_eq!(num,1);
let cat2 = CategoryCode::try_from(1).unwrap();
assert_eq!(cat2,cat);Variants§
Escape = 0
Escape character (0); usually \
BeginGroup = 1
Begin group character (1); usually {
EndGroup = 2
End group character (2); usually }
MathShift = 3
Math shift character (3); usually $
AlignmentTab = 4
Alignment tab character (4); usually &
EOL = 5
End of line character (5); usually \n
Parameter = 6
Parameter character (6); usually #
Superscript = 7
Superscript character (7); usually ^
Subscript = 8
Subscript character (8); usually _
Ignored = 9
Ignored character (9)
Space = 10
Space character (10); usually
Letter = 11
Letter character (11), usually a-z and A-Z
Other = 12
Other character (12), usually e.g. @, !, ?, etc.
Active = 13
Active character (13); usually ~
Comment = 14
Comment character (14); usually %
Invalid = 15
Invalid character (15)
Trait Implementations§
Source§impl Clone for CategoryCode
impl Clone for CategoryCode
Source§fn clone(&self) -> CategoryCode
fn clone(&self) -> CategoryCode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CategoryCode
impl Debug for CategoryCode
Source§impl Default for CategoryCode
impl Default for CategoryCode
Source§fn default() -> CategoryCode
fn default() -> CategoryCode
Returns the “default value” for a type. Read more
Source§impl Display for CategoryCode
impl Display for CategoryCode
Source§impl From<CategoryCode> for CommandCode
impl From<CategoryCode> for CommandCode
Source§fn from(value: CategoryCode) -> Self
fn from(value: CategoryCode) -> Self
Converts to this type from the input type.
Source§impl From<CategoryCode> for u8
impl From<CategoryCode> for u8
Source§fn from(cc: CategoryCode) -> Self
fn from(cc: CategoryCode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CategoryCode
impl PartialEq for CategoryCode
Source§impl TryFrom<u8> for CategoryCode
impl TryFrom<u8> for CategoryCode
impl Copy for CategoryCode
impl Eq for CategoryCode
impl StructuralPartialEq for CategoryCode
Auto Trait Implementations§
impl Freeze for CategoryCode
impl RefUnwindSafe for CategoryCode
impl Send for CategoryCode
impl Sync for CategoryCode
impl Unpin for CategoryCode
impl UnsafeUnpin for CategoryCode
impl UnwindSafe for CategoryCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<ET, Err, A> IntoErr<ET, Err> for Awhere
ET: EngineTypes,
Err: From<A>,
impl<ET, Err, A> IntoErr<ET, Err> for Awhere
ET: EngineTypes,
Err: From<A>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.