pub struct Clipped { /* private fields */ }Expand description
Text that may be shown shortened. Holding the full value is not optional, so a
component can always declare data-fc-truncated and keep the full value reachable.
use fc_dioxus::prelude::Clipped;
let id = Clipped::chars("9f2c1e04b7a3", 7);
assert_eq!(id.shown(), "9f2c1e0…");
assert!(id.is_truncated());
assert!(!Clipped::chars("short", 7).is_truncated());Implementations§
Source§impl Clipped
impl Clipped
Sourcepub fn lines(text: impl Into<String>, lines: u8) -> Self
pub fn lines(text: impl Into<String>, lines: u8) -> Self
Text the CSS clamps to lines. It may or may not overflow, so it is declared
truncated whenever it is clamped at all.
Sourcepub fn chars(text: impl Into<String>, chars: usize) -> Self
pub fn chars(text: impl Into<String>, chars: usize) -> Self
Text shortened to at most chars characters, never splitting one.
Sourcepub fn is_truncated(&self) -> bool
pub fn is_truncated(&self) -> bool
Whether the displayed text may be less than the full value.
Trait Implementations§
impl Eq for Clipped
impl StructuralPartialEq for Clipped
Auto Trait Implementations§
impl Freeze for Clipped
impl RefUnwindSafe for Clipped
impl Send for Clipped
impl Sync for Clipped
impl Unpin for Clipped
impl UnsafeUnpin for Clipped
impl UnwindSafe for Clipped
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.