Struct Part
struct Part { ... }
Parts are used as annotations for formatted strings.
For example, a string like Alice, Bob could assign a NAME part to the
substrings Alice and Bob, and a PUNCTUATION part to , . This allows
for example to apply styling only to names.
Part contains two fields, whose usage is left up to the producer of the Writeable.
Conventionally, the category field will identify the formatting logic that produces
the string/parts, whereas the value field will have semantic meaning. NAME and
PUNCTUATION could thus be defined as
# use Part;
const NAME: Part = Part ;
const PUNCTUATION: Part = Part ;
That said, consumers should not usually have to inspect Part internals. Instead,
formatters should expose the Parts they produces as constants.
Fields
category: &'static strvalue: &'static str
Implementations
impl Part
impl Clone for Part
fn clone(self: &Self) -> Part
impl Copy for Part
impl Debug for Part
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for Part
impl PartialEq for Part
fn eq(self: &Self, other: &Part) -> bool
impl RefUnwindSafe for Part
impl Send for Part
impl StructuralPartialEq for Part
impl Sync for Part
impl Unpin for Part
impl UnsafeUnpin for Part
impl UnwindSafe for Part
impl<T> Any for Part
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Part
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Part
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Part
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Part
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Part
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Part
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Part
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Part
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>