pub struct Names {
pub names: BTreeMap<String, String>,
}Expand description
Every display name, by name id.
Fields§
§names: BTreeMap<String, String>Display names by id.
Implementations§
Source§impl Names
impl Names
Sourcepub fn longest(&self, widths: &CellWidths) -> usize
pub fn longest(&self, widths: &CellWidths) -> usize
Cells of the longest display name (0 for an empty table), a wide
character of widths two cells: what every name token counts as
when measuring text, so a rename can’t push a line past its limit.
Sourcepub fn substitute<'t>(&self, text: &'t str) -> Cow<'t, str>
pub fn substitute<'t>(&self, text: &'t str) -> Cow<'t, str>
text with every name token replaced by its display name. Other
tokens (the game’s) and unknown ids are left as written (the
dialogue validator rejects unknown ones).
Sourcepub fn literal_in(&self, text: &str) -> Option<(&str, &str)>
pub fn literal_in(&self, text: &str) -> Option<(&str, &str)>
The longest display name written literally in text (outside
tokens), with its id; of equally long ones, the first by id. The
longest, so that a full name is reported as itself and not as one
of its short forms (Ada Brook is smith, not family.brook).
See literal_form for what counts.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Names
impl<'de> Deserialize<'de> for Names
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Names
impl StructuralPartialEq for Names
Auto Trait Implementations§
impl Freeze for Names
impl RefUnwindSafe for Names
impl Send for Names
impl Sync for Names
impl Unpin for Names
impl UnsafeUnpin for Names
impl UnwindSafe for Names
Blanket Implementations§
impl<K> Bakeable for K
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