pub struct Named { /* private fields */ }Expand description
The hooks of a game whose only tokens are the names table’s: no lines
of its own, and {n:<id>} and {N:<id>} are filled in with
Names::substitute. It goes with the check’s
NoTokens.
use std::sync::Arc;
use shuyi_assets::names::Names;
use shuyi_ui::dialogue::{DialogueHooks, Named};
let mut names = Names::default();
names.names.insert("smith".into(), "ada brook".into());
let hooks = Named::new(Arc::new(names));
assert_eq!(hooks.fill("Hello, {n:smith}."), "Hello, ada brook.");Implementations§
Trait Implementations§
Source§impl DialogueHooks for Named
impl DialogueHooks for Named
impl Eq for Named
impl StructuralPartialEq for Named
Auto Trait Implementations§
impl Freeze for Named
impl RefUnwindSafe for Named
impl Send for Named
impl Sync for Named
impl Unpin for Named
impl UnsafeUnpin for Named
impl UnwindSafe for Named
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