Struct gpui2::StyledText
source · pub struct StyledText { /* private fields */ }
Implementations§
source§impl StyledText
impl StyledText
sourcepub fn new(text: SharedString, runs: Vec<TextRun>) -> Self
pub fn new(text: SharedString, runs: Vec<TextRun>) -> Self
Renders text with runs of different styles.
Callers are responsible for setting the correct style for each run. For text with a uniform style, you can usually avoid calling this constructor and just pass text directly.
Trait Implementations§
source§impl Element for StyledText
impl Element for StyledText
source§impl RenderOnce for StyledText
impl RenderOnce for StyledText
type Element = StyledText
fn element_id(&self) -> Option<ElementId>
fn render_once(self) -> Self::Element
fn render_into_any(self) -> AnyElement
fn draw<T, R>( self, origin: Point<Pixels>, available_space: Size<T>, cx: &mut WindowContext<'_>, f: impl FnOnce(&mut <Self::Element as Element>::State, &mut WindowContext<'_>) -> R ) -> Rwhere T: Clone + Default + Debug + Into<AvailableSpace>,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,
fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,
Auto Trait Implementations§
impl RefUnwindSafe for StyledText
impl Send for StyledText
impl Sync for StyledText
impl Unpin for StyledText
impl UnwindSafe for StyledText
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