[−][src]Struct embedded_text::style::TabSize
Tab size helper
This type makes it more obvious what unit is used to define the width of tabs. The default tab size is 4 spaces.
Implementations
impl<F: Font> TabSize<F>
[src]
pub fn spaces(n: u32) -> Self
[src]
Calculate tab size from a number of spaces in the current font.
pub fn pixels(px: i32) -> Self
[src]
Define the tab size in pixels.
pub fn next_width(self, pos: i32) -> u32
[src]
Calculate the rendered with of the next tab
Trait Implementations
impl<F: Clone> Clone for TabSize<F>
[src]
impl<F: Copy> Copy for TabSize<F>
[src]
impl<F: Debug> Debug for TabSize<F>
[src]
impl<F: Font> Default for TabSize<F>
[src]
impl<F: Eq> Eq for TabSize<F>
[src]
impl<F: Hash> Hash for TabSize<F>
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<F: Ord> Ord for TabSize<F>
[src]
pub fn cmp(&self, other: &TabSize<F>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<F: PartialEq> PartialEq<TabSize<F>> for TabSize<F>
[src]
impl<F: PartialOrd> PartialOrd<TabSize<F>> for TabSize<F>
[src]
pub fn partial_cmp(&self, other: &TabSize<F>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &TabSize<F>) -> bool
[src]
pub fn le(&self, other: &TabSize<F>) -> bool
[src]
pub fn gt(&self, other: &TabSize<F>) -> bool
[src]
pub fn ge(&self, other: &TabSize<F>) -> bool
[src]
impl<F> StructuralEq for TabSize<F>
[src]
impl<F> StructuralPartialEq for TabSize<F>
[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for TabSize<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for TabSize<F> where
F: Send,
F: Send,
impl<F> Sync for TabSize<F> where
F: Sync,
F: Sync,
impl<F> Unpin for TabSize<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for TabSize<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,