# Struct BorrowedWithFontSystem

    pub struct BorrowedWithFontSystem<'a, T> { /* private fields */ }

Expand description

A value borrowed together with an `FontSystem`

## Implementations§

§

### impl BorrowedWithFontSystem<'_, Buffer>

#### pub fn shape_until_cursor(&mut self, cursor: Cursor, prune: bool)

Shape lines until cursor, also scrolling to include cursor in view

#### pub fn line_shape(&mut self, line_i: usize) -> Option<&ShapeLine>

Shape the provided line index and return the result

#### pub fn line_layout(&mut self, line_i: usize) -> Option<&[LayoutLine]>

Lay out the provided line index and return the result

#### pub fn set_metrics(&mut self, metrics: Metrics)

Set the current `Metrics`.

##### §Panics

Will panic if `metrics.font_size` is zero.

#### pub fn set_hinting(&mut self, hinting: Hinting)

Set the current `Hinting` strategy.

#### pub fn set_wrap(&mut self, wrap: Wrap)

Set the current `Wrap`.

#### pub fn set_ellipsize(&mut self, ellipsize: Ellipsize)

Set the current `Ellipsize`.

#### pub fn set_size(&mut self, width_opt: Option<f32>, height_opt: Option<f32>)

Set the current buffer dimensions.

#### pub fn set_metrics_and_size( &mut self, metrics: Metrics, width_opt: Option<f32>, height_opt: Option<f32>, )

Set the current `Metrics` and buffer dimensions at the same time.

##### §Panics

Will panic if `metrics.font_size` is zero.

#### pub fn set_tab_width(&mut self, tab_width: u16)

Set tab width (number of spaces between tab stops).

A `tab_width` of 0 is ignored.

#### pub fn set_monospace_width(&mut self, monospace_width: Option<f32>)

Set monospace width monospace glyphs should be resized to match. `None` means don’t resize.

#### pub fn set_text( &mut self, text: &str, attrs: &Attrs<'_>, shaping: Shaping, alignment: Option<Align>, )

Set text of buffer, using provided attributes for each line by default.

#### pub fn set_rich_text<'r, 's, I>( &mut self, spans: I, default_attrs: &Attrs<'_>, shaping: Shaping, alignment: Option<Align>, )
where I: IntoIterator<Item = (&'s str, Attrs<'r>)>,

Set text of buffer, using an iterator of styled spans (pairs of text and attributes).

#### pub fn shape_until_scroll(&mut self, prune: bool)

Shape lines until scroll, resolving any pending dirty state first.

See `Buffer::shape_until_scroll`.

#### pub fn layout_runs(&mut self) -> LayoutRunIter<'_> ⓘ

Get the visible layout runs for rendering and other tasks.

Automatically resolves any pending dirty state.

#### pub fn hit(&mut self, x: f32, y: f32) -> Option<Cursor>

Convert x, y position to Cursor (hit detection).

Automatically resolves any pending dirty state.

#### pub fn cursor_motion( &mut self, cursor: Cursor, cursor_x_opt: Option<i32>, motion: Motion, ) -> Option<(Cursor, Option<i32>)>

Apply a `Motion` to a `Cursor`

#### pub fn draw<F>(&mut self, cache: &mut SwashCache, color: Color, f: F)
where F: FnMut(i32, i32, u32, u32, Color),

Draw the buffer.

Automatically resolves any pending dirty state.

§

### impl BorrowedWithFontSystem<'_, Editor<'_>>

#### pub fn draw<F>( &mut self, cache: &mut SwashCache, text_color: Color, cursor_color: Color, selection_color: Color, selected_text_color: Color, f: F, )
where F: FnMut(i32, i32, u32, u32, Color),

§

### impl<'buffer, E> BorrowedWithFontSystem<'_, E>
where E: Edit<'buffer>,

#### pub fn with_buffer_mut<F, T>(&mut self, f: F) -> T
where F: FnOnce(&mut BorrowedWithFontSystem<'_, Buffer>) -> T,

Get the internal `Buffer`, mutably

#### pub fn set_tab_width(&mut self, tab_width: u16)

Set the current tab width. A `tab_width` of 0 is not allowed, and will be ignored

#### pub fn shape_as_needed(&mut self, prune: bool)

Shape lines until scroll, after adjusting scroll if the cursor moved

#### pub fn action(&mut self, action: Action)

Perform an Action on the editor

## Trait Implementations§

§

### impl<'a, T> Debug for BorrowedWithFontSystem<'a, T>
where T: Debug,

§

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

Formats the value using the given formatter. Read more
§

### impl<T> Deref for BorrowedWithFontSystem<'_, T>

§

#### type Target = T

The resulting type after dereferencing.
§

#### fn deref(&self) -> &<BorrowedWithFontSystem<'_, T> as Deref>::Target

Dereferences the value.
§

### impl<T> DerefMut for BorrowedWithFontSystem<'_, T>

§

#### fn deref_mut(&mut self) -> &mut <BorrowedWithFontSystem<'_, T> as Deref>::Target

Mutably dereferences the value.

## Auto Trait Implementations§

§

### impl<'a, T> Freeze for BorrowedWithFontSystem<'a, T>

§

### impl<'a, T> !RefUnwindSafe for BorrowedWithFontSystem<'a, T>

§

### impl<'a, T> Send for BorrowedWithFontSystem<'a, T>
where T: Send,

§

### impl<'a, T> Sync for BorrowedWithFontSystem<'a, T>
where T: Sync,

§

### impl<'a, T> Unpin for BorrowedWithFontSystem<'a, T>

§

### impl<'a, T> !UnwindSafe for BorrowedWithFontSystem<'a, T>

## Blanket Implementations§

§

### impl<T, A, P> Access<T> for P
where A: Access<T> + ?Sized, P: Deref<Target = A>,

§

#### type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more
§

#### fn load(&self) -> <P as Access<T>>::Guard

The loading method. Read more
Source§

### impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

#### fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

#### fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
§

### impl<T> Also for T

§

#### fn also<F>(self, block: F) -> Self
where F: FnOnce(&mut Self),

Apply a function to this value and return the (possibly) modified value.
Source§

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

Source§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
§

### impl<T, Res> Apply<Res> for T
where T: ?Sized,

§

#### fn apply<F>(self, f: F) -> Res
where F: FnOnce(Self) -> Res, Self: Sized,

Apply a function which takes the parameter by value.
§

#### fn apply_ref<F>(&self, f: F) -> Res
where F: FnOnce(&Self) -> Res,

Apply a function which takes the parameter by reference.
§

#### fn apply_mut<F>(&mut self, f: F) -> Res
where F: FnOnce(&mut Self) -> Res,

Apply a function which takes the parameter by mutable reference.
Source§

### impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

#### fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

### impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

#### fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

#### type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in `parameters` when converting.
Source§

#### fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts `self` into `C`, using the provided parameters.
Source§

### impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

#### fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

### impl<T> Downcast for T
where T: Any,

§

#### fn into_any(self: Box<T>) -> Box<dyn Any>

Convert `Box<dyn Trait>` (where `Trait: Downcast`) to `Box<dyn Any>`. `Box<dyn Any>` can then be further `downcast` into `Box<ConcreteType>` where `ConcreteType` implements `Trait`.
§

#### fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert `Rc<Trait>` (where `Trait: Downcast`) to `Rc<Any>`. `Rc<Any>` can then be further `downcast` into `Rc<ConcreteType>` where `ConcreteType` implements `Trait`.
§

#### fn as_any(&self) -> &(dyn Any + 'static)

Convert `&Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s.
§

#### fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert `&mut Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&mut Any`’s vtable from `&mut Trait`’s.
§

### impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

#### fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert `Arc<Trait>` (where `Trait: Downcast`) to `Arc<Any>`. `Arc<Any>` can then be further `downcast` into `Arc<ConcreteType>` where `ConcreteType` implements `Trait`.
§

### impl<T, A> DynAccess<T> for A
where A: Access<T>, <A as Access<T>>::Guard: 'static,

§

#### fn load(&self) -> DynGuard<T>

The equivalent of [`Access::load`].
Source§

### impl<T> From<T> for T

Source§

#### fn from(t: T) -> T

Returns the argument unchanged.

Source§

### impl<T> FromAngle<T> for T

Source§

#### fn from_angle(angle: T) -> T

Performs a conversion from `angle`.
Source§

### impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

#### fn from_stimulus(other: U) -> T

Converts `other` into `Self`, while performing the appropriate scaling, rounding and clamping.
§

### impl<T> Instrument for T

§

#### fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [`Span`], returning an `Instrumented` wrapper. Read more
§

#### fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current `Span`, returning an `Instrumented` wrapper. Read more
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> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

#### fn into_angle(self) -> U

Performs a conversion into `T`.
§

### impl<State, Message> IntoBoot<State, Message> for State

§

#### fn into_boot(self) -> (State, Task<Message>)

Turns some type into the initial state of some `Application`.
Source§

### impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

#### type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in `parameters` when converting.
Source§

#### fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts `self` into `C`, using the provided parameters.
Source§

### impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

#### fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

### impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

#### fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

### impl<T> IntoStimulus<T> for T

Source§

#### fn into_stimulus(self) -> T

Converts `self` into `T`, while performing the appropriate scaling, rounding and clamping.
Source§

### impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

#### type Target = T

🔬This is a nightly-only experimental API. (`arbitrary_self_types`)
The target type on which the method may be called.
Source§

### impl<R> Rng for R
where R: RngCore + ?Sized,

Source§

#### fn random<T>(&mut self) -> T
where StandardUniform: Distribution<T>,

Return a random value via the `StandardUniform` distribution. Read more
Source§

#### fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
where Self: Sized, StandardUniform: Distribution<T>,

Return an iterator over `random` variates Read more
Source§

#### fn random_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

Generate a random value in the given range. Read more
Source§

#### fn random_bool(&mut self, p: f64) -> bool

Return a bool with a probability `p` of being true. Read more
Source§

#### fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of `numerator/denominator` of being true. Read more
Source§

#### fn sample<T, D>(&mut self, distr: D) -> T
where D: Distribution<T>,

Sample a new value, using the given distribution. Read more
Source§

#### fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>
where D: Distribution<T>, Self: Sized,

Create an iterator that generates values using the given distribution. Read more
Source§

#### fn fill<T>(&mut self, dest: &mut T)
where T: Fill + ?Sized,

Fill any type implementing `Fill` with random data Read more
Source§

#### fn gen<T>(&mut self) -> T
where StandardUniform: Distribution<T>,

👎Deprecated since 0.9.0: Renamed to `random` to avoid conflict with the new `gen` keyword in Rust 2024.
Alias for `Rng::random`.
Source§

#### fn gen_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

👎Deprecated since 0.9.0: Renamed to `random_range`
Alias for `Rng::random_range`.
Source§

#### fn gen_bool(&mut self, p: f64) -> bool

👎Deprecated since 0.9.0: Renamed to `random_bool`
Alias for `Rng::random_bool`.
Source§

#### fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool

👎Deprecated since 0.9.0: Renamed to `random_ratio`
Alias for `Rng::random_ratio`.
Source§

### impl<T> RngCore for T
where T: DerefMut, <T as Deref>::Target: RngCore,

Source§

#### fn next_u32(&mut self) -> u32

Return the next random `u32`. Read more
Source§

#### fn next_u64(&mut self) -> u64

Return the next random `u64`. Read more
Source§

#### fn fill_bytes(&mut self, dst: &mut [u8])

Fill `dest` with random data. Read more
Source§

### impl<T> Same for T

Source§

#### type Output = T

Should always be `Self`
Source§

### impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

#### type Error = <C as TryFromComponents<T>>::Error

The error for when `try_into_colors` fails to cast.
Source§

#### fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. 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<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

#### fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an `OutOfBounds` error is returned which contains the unclamped color. Read more
Source§

### impl<R> TryRngCore for R
where R: RngCore + ?Sized,

Source§

#### type Error = Infallible

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

#### fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>

Return the next random `u32`.
Source§

#### fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>

Return the next random `u64`.
Source§

#### fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>

Fill `dest` entirely with random data.
Source§

#### fn unwrap_err(self) -> UnwrapErr<Self>
where Self: Sized,

Wrap RNG with the `UnwrapErr` wrapper.
Source§

#### fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>

Wrap RNG with the `UnwrapMut` wrapper.
Source§

#### fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>
where Self: Sized,

Convert an `RngCore` to a `RngReadAdapter`.
Source§

### impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

#### fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

### impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

#### fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
§

### impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

#### fn vzip(self) -> V

§

### impl<T> WithSubscriber for T

§

#### fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided `Subscriber` to this type, returning a [`WithDispatch`] wrapper. Read more
§

#### fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default `Subscriber` to this type, returning a [`WithDispatch`] wrapper. Read more
Source§

### impl<T> CryptoRng for T
where T: DerefMut, <T as Deref>::Target: CryptoRng,

§

### impl<T> MaybeClone for T

§

### impl<T> MaybeDebug for T

§

### impl<T> MaybeSend for T
where T: Send,

§

### impl<T> MaybeSend for T
where T: Send,

§

### impl<T> MaybeSync for T
where T: Sync,

§

### impl<T> MaybeSync for T
where T: Sync,

Source§

### impl<R> TryCryptoRng for R
where R: CryptoRng + ?Sized,