Struct BorrowedWithFontSystem
pub struct BorrowedWithFontSystem<'a, T> { /* private fields */ }Expand description
A value borrowed together with an FontSystem
Implementations§
§impl BorrowedWithFontSystem<'_, Buffer>
impl BorrowedWithFontSystem<'_, Buffer>
pub fn shape_until_cursor(&mut self, cursor: Cursor, prune: bool)
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>
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]>
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)
pub fn set_metrics(&mut self, metrics: Metrics)
pub fn set_hinting(&mut self, hinting: Hinting)
pub fn set_hinting(&mut self, hinting: Hinting)
Set the current Hinting strategy.
pub fn set_ellipsize(&mut self, ellipsize: Ellipsize)
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>)
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>,
)
pub fn set_metrics_and_size( &mut self, metrics: Metrics, width_opt: Option<f32>, height_opt: Option<f32>, )
pub fn set_tab_width(&mut self, tab_width: u16)
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>)
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>,
)
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>,
)
pub fn set_rich_text<'r, 's, I>( &mut self, spans: I, default_attrs: &Attrs<'_>, shaping: Shaping, alignment: Option<Align>, )
Set text of buffer, using an iterator of styled spans (pairs of text and attributes).
pub fn shape_until_scroll(&mut self, prune: bool)
pub fn shape_until_scroll(&mut self, prune: bool)
Shape lines until scroll, resolving any pending dirty state first.
pub fn layout_runs(&mut self) -> LayoutRunIter<'_> ⓘ
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>
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.
§impl BorrowedWithFontSystem<'_, Editor<'_>>
impl BorrowedWithFontSystem<'_, Editor<'_>>
§impl<'buffer, E> BorrowedWithFontSystem<'_, E>where
E: Edit<'buffer>,
impl<'buffer, E> BorrowedWithFontSystem<'_, E>where
E: Edit<'buffer>,
pub fn with_buffer_mut<F, T>(&mut self, f: F) -> T
pub fn with_buffer_mut<F, T>(&mut self, f: F) -> T
Get the internal Buffer, mutably
pub fn set_tab_width(&mut self, tab_width: u16)
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)
pub fn shape_as_needed(&mut self, prune: bool)
Shape lines until scroll, after adjusting scroll if the cursor moved
Trait Implementations§
§impl<'a, T> Debug for BorrowedWithFontSystem<'a, T>where
T: Debug,
impl<'a, T> Debug for BorrowedWithFontSystem<'a, T>where
T: Debug,
§impl<T> Deref for BorrowedWithFontSystem<'_, T>
impl<T> Deref for BorrowedWithFontSystem<'_, T>
§impl<T> DerefMut for BorrowedWithFontSystem<'_, T>
impl<T> DerefMut for BorrowedWithFontSystem<'_, T>
§fn deref_mut(&mut self) -> &mut <BorrowedWithFontSystem<'_, T> as Deref>::Target
fn deref_mut(&mut self) -> &mut <BorrowedWithFontSystem<'_, T> as Deref>::Target
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> UnsafeUnpin for BorrowedWithFontSystem<'a, T>
impl<'a, T> !UnwindSafe for BorrowedWithFontSystem<'a, T>
Blanket Implementations§
§impl<R> TryRngCore for Rwhere
R: TryRng,
impl<R> TryRngCore for Rwhere
R: TryRng,
§impl<T, A, P> Access<T> for P
impl<T, A, P> Access<T> for P
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
§impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<R> Rng for Rwhere
R: TryRng<Error = Infallible> + ?Sized,
impl<R> Rng for Rwhere
R: TryRng<Error = Infallible> + ?Sized,
§impl<R> RngExt for Rwhere
R: Rng + ?Sized,
impl<R> RngExt for Rwhere
R: Rng + ?Sized,
§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read more§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>where
Self: Sized,
StandardUniform: Distribution<T>,
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>where
Self: Sized,
StandardUniform: Distribution<T>,
§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read more§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read more§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<R> TryRng for R
impl<R> TryRng for R
§type Error = <<R as Deref>::Target as TryRng>::Error
type Error = <<R as Deref>::Target as TryRng>::Error
§fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
u32.§fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
u64.§fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
dst entirely with random data.