Skip to main content

Signal

Enum Signal 

Source
pub enum Signal {
Show 20 variants NewLine, Tab, PossibleNewLine, SpaceOrNewLine, ExpectNewLine, QueueStartIndent, StartIndent, FinishIndent, StartNewLineGroup, FinishNewLineGroup, SingleIndent, StartIgnoringIndent, FinishIgnoringIndent, StartResettingIndent, FinishResettingIndent, StartAlign(u8), FinishAlign, StartForceNoNewLines, FinishForceNoNewLines, SpaceIfNotTrailing,
}

Variants§

§

NewLine

Signal that a new line should occur based on the printer settings.

§

Tab

Signal that a tab should occur based on the printer settings.

§

PossibleNewLine

Signal that the current location could be a newline when exceeding the line width.

§

SpaceOrNewLine

Signal that the current location should be a space, but could be a newline if exceeding the line width.

§

ExpectNewLine

Expect the next character to be a newline. If it’s not, force a newline.

§

QueueStartIndent

Queue a start indent to be set after the next written item.

§

StartIndent

Signal the start of a section that should be indented.

§

FinishIndent

Signal the end of a section that should be indented.

§

StartNewLineGroup

Signal the start of a group of print items that have a lower precedence for being broken up with a newline for exceeding the line width.

§

FinishNewLineGroup

Signal the end of a newline group.

§

SingleIndent

Signal that a single indent should occur based on the printer settings.

§

StartIgnoringIndent

Signal to the printer that it should stop using indentation.

§

FinishIgnoringIndent

Signal to the printer that it should start using indentation again.

§

StartResettingIndent

Signal the start of a section whose indentation starts from no indentation instead of the current indentation, which can then be indented with StartIndent (ex. to indent relative to text written as is while ignoring the indentation).

The indent levels in the section (ex. of an IndentLevel info) count from the start of the section, so they shouldn’t be compared with the indent levels from outside of it. The column numbers are the actual columns. A QueueStartIndent from before the section is applied after it.

§

FinishResettingIndent

Signal the end of a section that reset the indentation, which restores the indentation from before. The indents and aligns started in the section must be finished first.

§

StartAlign(u8)

Signal the start of a section that’s aligned by the number of columns of spaces after the indentation (ex. to line up with text that isn’t at an indent level). The alignment always goes after the indentation, so with tabs it’s tabs then spaces.

The alignment isn’t part of the indent levels (ex. of an IndentLevel info), but it’s included in the column numbers.

§

FinishAlign

Signal the end of the most recent section that aligns.

§

StartForceNoNewLines

Signal to the printer that it shouldn’t print any new lines.

§

FinishForceNoNewLines

Signal to the printer that it should finish not printing any new lines.

§

SpaceIfNotTrailing

Signal that a space should occur if not trailing.

Trait Implementations§

Source§

impl Clone for Signal

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Signal

Source§

impl Debug for Signal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Signal

Source§

impl<'a> IntoPrintItems<'a> for Signal

Source§

fn into_print_items(self, arena: &'a Arena) -> PrintItems<'a>

Source§

impl PartialEq for Signal

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Signal

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Signal

Auto Trait Implementations§

§

impl Forget for Signal

§

impl Freeze for Signal

§

impl Move for Signal

§

impl RefUnwindSafe for Signal

§

impl Send for Signal

§

impl Sync for Signal

§

impl Unpin for Signal

§

impl UnsafeUnpin for Signal

§

impl UnwindSafe for Signal

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.