pub struct MarkupSpan {
pub name: String,
pub start: usize,
pub length: usize,
pub properties: Vec<(String, String)>,
}Expand description
A resolved inline markup span: a named annotation over a byte range in the stripped display text.
Spans are produced at runtime, after expression substitution, so start
and length are byte offsets into the final DialogueEvent::Line::text
/ DialogueOption::text string.
The runtime assigns no meaning to span names or properties. Your game
decides what [wave], [color value=red], or [pause /] means and how
to render it.
Fields§
§name: StringThe markup tag name, e.g. wave for [wave]text[/wave].
start: usizeByte offset of the first character of the spanned text in the display string.
length: usizeByte length of the spanned text. Zero for self-closing tags.
properties: Vec<(String, String)>Zero or more (key, value) pairs from the tag, e.g. [("value", "red")]
for [color value=red].
Trait Implementations§
Source§impl Clone for MarkupSpan
impl Clone for MarkupSpan
Source§fn clone(&self) -> MarkupSpan
fn clone(&self) -> MarkupSpan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarkupSpan
impl Debug for MarkupSpan
Source§impl PartialEq for MarkupSpan
impl PartialEq for MarkupSpan
impl Eq for MarkupSpan
impl StructuralPartialEq for MarkupSpan
Auto Trait Implementations§
impl Freeze for MarkupSpan
impl RefUnwindSafe for MarkupSpan
impl Send for MarkupSpan
impl Sync for MarkupSpan
impl Unpin for MarkupSpan
impl UnsafeUnpin for MarkupSpan
impl UnwindSafe for MarkupSpan
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.