pub struct Var<S = String> {
pub name: S,
pub desc: Option<S>,
pub keywords: FlagSet<EntityKeyword>,
}Expand description
The <VAR> tag is just like the <!ENTITY> tag, except that the value of the variable is
placed between the <VAR> and </VAR> tags, and this value is displayed to the user.
§Examples
use mxp::entity::EntityKeyword;
assert_eq!(
"<VAR Hp DESC=Health PUBLISH>".parse::<mxp::Var>(),
Ok(mxp::Var {
name: "Hp".into(),
desc: Some("Health".into()),
keywords: EntityKeyword::Publish.into(),
}),
);Fields§
§name: SVariable name.
desc: Option<S>Variable description.
keywords: FlagSet<EntityKeyword>Keywords.
Implementations§
Source§impl<S: AsRef<str>> Var<S>
impl<S: AsRef<str>> Var<S>
Sourcepub fn borrow_text(&self) -> Var<&str>
pub fn borrow_text(&self) -> Var<&str>
Returns a new struct that borrows text from this one.
Sourcepub fn with_value<'a>(&'a self, value: &'a str) -> EntityDefinition<'a>
pub fn with_value<'a>(&'a self, value: &'a str) -> EntityDefinition<'a>
Creates an EntityDefinition from properties and a value.
Trait Implementations§
impl<S: Copy> Copy for Var<S>
impl<S: Eq> Eq for Var<S>
impl<S> StructuralPartialEq for Var<S>
Auto Trait Implementations§
impl<S> Freeze for Var<S>where
S: Freeze,
impl<S> RefUnwindSafe for Var<S>where
S: RefUnwindSafe,
impl<S> Send for Var<S>where
S: Send,
impl<S> Sync for Var<S>where
S: Sync,
impl<S> Unpin for Var<S>where
S: Unpin,
impl<S> UnsafeUnpin for Var<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Var<S>where
S: UnwindSafe,
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