LineNumbersCfg

Struct LineNumbersCfg 

Source
pub struct LineNumbersCfg<_U> { /* private fields */ }
Expand description

WidgetCfg for the LineNumbers widget

Contains a [LineNumbersOptions], which, unlike LineNumbersCfg, is modified by the &mut version of the builder pattern.

Implementations§

Source§

impl<_U> LineNumbersCfg<_U>

Source

pub fn absolute(self) -> Self

Absolute numbering, first line is 1, second is 2, etc

Source

pub fn relative(self) -> Self

Relative numbering, cursor line is 0, surrounding is 1, etc

Source

pub fn rel_abs(self) -> Self

A mix between relative and absolute numbering

Will show the line number of the main cursor’s line, while showing the distance to it on every other line.

Source

pub fn align_left(self) -> Self

Aligns all numbers left

If you want the main line’s number to be aligned differently, call one of the align_main_* functions after this one.

Source

pub fn align_center(self) -> Self

Aligns all numbers to the center

If you want the main line’s number to be aligned differently, call one of the align_main_* functions after this one.

Source

pub fn align_right(self) -> Self

Aligns all numbers right

If you want the main line’s number to be aligned differently, call one of the align_main_* functions after this one.

Source

pub fn align_main_left(self) -> Self

Aligns onle the main line’s number to the left

Source

pub fn align_main_center(self) -> Self

Aligns onle the main line’s number to the center

Source

pub fn align_main_right(self) -> Self

Aligns onle the main line’s number to the right

Source

pub fn show_wraps(self) -> Self

Shows wrapping lines, is false by default

Source

pub fn hide_wraps(self) -> Self

Hides wrapping lines, is true by default

Source

pub fn on_the_right(self) -> Self

Place the LineNumbers on the right

Do note that this has no effect if done at runtime.

Trait Implementations§

Source§

impl<_U: Clone> Clone for LineNumbersCfg<_U>

Source§

fn clone(&self) -> LineNumbersCfg<_U>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<_U: Debug> Debug for LineNumbersCfg<_U>

Source§

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

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

impl<U: Ui> WidgetCfg<U> for LineNumbersCfg<U>

Source§

type Widget = LineNumbers<U>

The Widget that will be created by this WidgetCfg
Source§

fn build(self, pa: &mut Pass, info: BuildInfo<U>) -> (Self::Widget, PushSpecs)

Builds the Widget alongside PushSpecs Read more
Source§

impl<U: Ui> Copy for LineNumbersCfg<U>

Auto Trait Implementations§

§

impl<_U> Freeze for LineNumbersCfg<_U>

§

impl<_U> RefUnwindSafe for LineNumbersCfg<_U>
where _U: RefUnwindSafe,

§

impl<_U> Send for LineNumbersCfg<_U>
where _U: Send,

§

impl<_U> Sync for LineNumbersCfg<_U>
where _U: Sync,

§

impl<_U> Unpin for LineNumbersCfg<_U>
where _U: Unpin,

§

impl<_U> UnwindSafe for LineNumbersCfg<_U>
where _U: UnwindSafe,

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<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 = 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>,

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.
Source§

impl<Cfg, U> WidgetAlias<U> for Cfg
where Cfg: WidgetCfg<U>, U: Ui,

Source§

fn push_alias(self, builder: &mut RawUiBuilder<'_, U>) -> AreaId

“Pushes Widgets to a UiBuilder, in a specific U::Area