Struct ayaka_bindings_types::ActionText
source · pub struct ActionText {
pub text: VecDeque<ActionSubText>,
pub ch_key: Option<String>,
pub character: Option<String>,
pub vars: VarMap,
}Expand description
The text is a VecDeque<ActionSubText>.
The ActionSubText could be pushed and poped at front or back.
Generally, you should avoid using push_back directly.
To reduce allocations in serialization, you should use
push_back_chars and push_back_block.
let mut text = ActionText::default();
text.push_back_chars("Hello ");
assert_eq!(text.text[0], ActionSubText::chars("Hello "));
text.push_back_chars("world!");
assert_eq!(text.text[0], ActionSubText::chars("Hello world!"));Fields§
§text: VecDeque<ActionSubText>The full texts.
ch_key: Option<String>The key of current character.
character: Option<String>The current character.
vars: VarMapThe temp variables.
Implementations§
source§impl ActionText
impl ActionText
sourcepub fn push_back_chars<'a>(&mut self, s: impl Into<Cow<'a, str>>)
pub fn push_back_chars<'a>(&mut self, s: impl Into<Cow<'a, str>>)
Push the string as ActionSubText::Chars to the back.
If the back element is also ActionSubText::Chars, the string is appended.
sourcepub fn push_back_block<'a>(&mut self, s: impl Into<Cow<'a, str>>)
pub fn push_back_block<'a>(&mut self, s: impl Into<Cow<'a, str>>)
Push the string as ActionSubText::Block to the back.
If the back element is also ActionSubText::Block, the string is appended.
Trait Implementations§
source§impl Clone for ActionText
impl Clone for ActionText
source§fn clone(&self) -> ActionText
fn clone(&self) -> ActionText
Returns a copy 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 ActionText
impl Debug for ActionText
source§impl Default for ActionText
impl Default for ActionText
source§fn default() -> ActionText
fn default() -> ActionText
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ActionText
impl<'de> Deserialize<'de> for ActionText
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