Struct dprint_core::formatting::PrintItems

source ·
pub struct PrintItems { /* private fields */ }
Expand description

Print Items

Implementations§

source§

impl PrintItems

source

pub fn new() -> Self

source

pub fn into_rc_path(self) -> Option<PrintItemPath>

source

pub fn push_item(&mut self, item: PrintItem)

source§

impl PrintItems

source

pub fn extend(&mut self, items: PrintItems)

source

pub fn push_str_runtime_width_computed(&mut self, item: &'static str)

Pushes a string that will have its width computed at runtime.

Instead of using this, prefer to use push_sc where possible with the sc! macro from the dprint-core-macros crate.

source

pub fn push_force_current_line_indentation(&mut self)

source

pub fn push_space(&mut self)

source

pub fn push_sc(&mut self, item: &'static StringContainer)

Pushes a string that’s had its width computed at compile time.

source

pub fn push_string(&mut self, item: String)

source

pub fn push_condition(&mut self, condition: Condition)

source

pub fn push_info(&mut self, info: impl Into<Info>)

source

pub fn push_line_and_column(&mut self, line_and_col: LineAndColumn)

source

pub fn push_anchor(&mut self, anchor: impl Into<Anchor>)

source

pub fn push_reevaluation( &mut self, condition_reevaluation: ConditionReevaluation )

source

pub fn push_signal(&mut self, signal: Signal)

source

pub fn push_path(&mut self, path: PrintItemPath)

source

pub fn push_optional_path(&mut self, path: Option<PrintItemPath>)

source

pub fn is_empty(&self) -> bool

source

pub fn get_as_text(&self) -> String

source

pub fn iter(&self) -> PrintItemsIterator

Trait Implementations§

source§

impl Default for PrintItems

source§

fn default() -> PrintItems

Returns the “default value” for a type. Read more
source§

impl From<&'static PrintNodeCell> for PrintItems

source§

fn from(value: PrintItemPath) -> Self

Converts to this type from the input type.
source§

impl From<&'static str> for PrintItems

source§

fn from(value: &'static str) -> Self

Converts to this type from the input type.
source§

impl From<Condition> for PrintItems

source§

fn from(value: Condition) -> Self

Converts to this type from the input type.
source§

impl<T> From<Option<T>> for PrintItems
where PrintItems: From<T>,

source§

fn from(value: Option<T>) -> Self

Converts to this type from the input type.
source§

impl From<Signal> for PrintItems

source§

fn from(value: Signal) -> Self

Converts to this type from the input type.
source§

impl From<String> for PrintItems

source§

fn from(value: String) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.