[−][src]Struct celeste::binel::BinEl
An element stored in a BinFile
. Based on XML.
Fields
name: String
The name of the BinEl
.
attributes: HashMap<String, BinElAttr>
All attributes of the BinEl
. Unlike XML, these are strongly typed.
Methods
impl BinEl
[src]
pub fn new(name: &str) -> Self
[src]
Create a new BinEl
.
pub fn text(&self) -> Option<&String>
[src]
Get the text content of the BinEl
, if it exists.
pub fn text_mut(&mut self) -> Option<&mut String>
[src]
Get the mutable text content of the BinEl
, if it exists.
pub fn set_text(&mut self, text: &str) -> Option<BinElAttr>
[src]
Set the text content of the BinEl
.
pub fn insert(&mut self, child: Self)
[src]
Add a child to the BinEl
.
pub fn children<'a>(&'a self) -> impl Iterator<Item = &Self> + 'a
[src]
Get all children of the BinEl
.
pub fn children_mut<'a>(&'a mut self) -> impl Iterator<Item = &mut Self> + 'a
[src]
Get all children of the BinEl
, mutable.
pub fn get(&self, name: &str) -> &Vec<Self>
[src]
Get children of the BinEl
by name.
pub fn get_mut(&mut self, name: &str) -> &mut Vec<Self>
[src]
Get mutable children of the BinEl
by name.
pub fn drain<'a>(&'a mut self) -> impl Iterator<Item = Self> + 'a
[src]
Drain all children of the BinEl
.
Trait Implementations
impl BinElType for BinEl
[src]
fn into_binel(self) -> BinElValue
[src]
fn from_binel(binel: BinElValue) -> Result<Self>
[src]
fn maybe_attr() -> bool
[src]
fn maybe_elem() -> bool
[src]
Whether the BinElType
may serialize to a BinElValue::Element
. Recommended.
fn elem_name() -> Option<&'static str>
[src]
If there is a single valid name when deserializing from an element, and you know it at compile-time, implement this. Recommended. Read more
impl PartialEq<BinEl> for BinEl
[src]
impl Clone for BinEl
[src]
fn clone(&self) -> BinEl
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for BinEl
[src]
impl Debug for BinEl
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,