pub struct HighlightSegment<'a> { /* private fields */ }Expand description
A borrowed render segment with an optional highlight tag.
use dioxus_code::advanced::HighlightSegment;
let segment = HighlightSegment::new("fn", Some("k"));
assert_eq!(segment.text(), "fn");Implementations§
Source§impl<'a> HighlightSegment<'a>
impl<'a> HighlightSegment<'a>
Sourcepub const fn new(text: &'a str, tag: Option<&'static str>) -> Self
pub const fn new(text: &'a str, tag: Option<&'static str>) -> Self
Create a highlighted segment.
use dioxus_code::advanced::HighlightSegment;
let _segment = HighlightSegment::new("fn", Some("k"));Trait Implementations§
Source§impl<'a> Clone for HighlightSegment<'a>
impl<'a> Clone for HighlightSegment<'a>
Source§fn clone(&self) -> HighlightSegment<'a>
fn clone(&self) -> HighlightSegment<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for HighlightSegment<'a>
impl<'a> Debug for HighlightSegment<'a>
Source§impl<'a> PartialEq for HighlightSegment<'a>
impl<'a> PartialEq for HighlightSegment<'a>
Source§fn eq(&self, other: &HighlightSegment<'a>) -> bool
fn eq(&self, other: &HighlightSegment<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> Copy for HighlightSegment<'a>
impl<'a> Eq for HighlightSegment<'a>
impl<'a> StructuralPartialEq for HighlightSegment<'a>
Auto Trait Implementations§
impl<'a> Freeze for HighlightSegment<'a>
impl<'a> RefUnwindSafe for HighlightSegment<'a>
impl<'a> Send for HighlightSegment<'a>
impl<'a> Sync for HighlightSegment<'a>
impl<'a> Unpin for HighlightSegment<'a>
impl<'a> UnsafeUnpin for HighlightSegment<'a>
impl<'a> UnwindSafe for HighlightSegment<'a>
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,
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.