pub struct Span {
pub text: String,
pub style: u8,
pub href: Option<String>,
pub color: [u8; 3],
pub math: Option<Box<MathNode>>,
pub note: Option<Vec<Span>>,
}Expand description
A run of text with uniform styling, the unit of all text content.
Fields§
§text: StringThe text of the run.
style: u8Bit set of BOLD, ITALIC, MONO, MATH, SUP, SUB, SANS.
href: Option<String>Link target: an in-document anchor (#ref-12) or an external URL.
color: [u8; 3]Text colour as RGB; black is the default.
math: Option<Box<MathNode>>A formula in running text whose structure is known (the Office Math
of a Word document): the span stands for it, and text is its plain
text. None for the spans of a PDF, whose formulas are rebuilt from
their styles.
note: Option<Vec<Span>>An added note attached at this point of the text (the <note>
tag of the editable JSON): the span is the note’s call, and the
note’s content is these spans (styled text, without formulas or
other notes). The call’s text is its mark: empty in the document,
filled with the note’s number only by the outputs that number the
notes themselves. None for every other span.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Forget for Span
impl Freeze for Spanwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const MathNode is !null: Freeze,
PhantomData<MathNode>: Freeze,
PhantomData<Span>: Freeze,
impl Move for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Spanwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const MathNode is !null: UnsafeUnpin,
PhantomData<MathNode>: UnsafeUnpin,
PhantomData<Span>: UnsafeUnpin,
impl UnwindSafe for Span
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.