Struct yharnam::Line[][src]

pub struct Line {
    pub id: String,
    pub substitutions: Vec<String>,
}

A line of dialogue, sent from the VirtualMachine to the game.

When the game receives a Line, it should do the following things to prepare the line for presentation to the user.

  1. Use the value in the id field to look up the appropriate user-facing text in the string table.

  2. For each of the entries in the substitutions field, replace the corresponding placeholder with the entry. That is, the text “{0}” should be replaced with the value of substitutions[0], “{1}” with substitutions[1], and so on.

  3. Use expand_format_functions to expand all format functions in the line.

You do not create instances of this struct yourself. They are created by the VirtualMachine during program execution.

Fields

id: Stringsubstitutions: Vec<String>

Trait Implementations

impl Clone for Line[src]

impl Debug for Line[src]

Auto Trait Implementations

impl RefUnwindSafe for Line

impl Send for Line

impl Sync for Line

impl Unpin for Line

impl UnwindSafe for Line

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.