[][src]Struct celeste::binel::BinEl

pub struct BinEl {
    pub name: String,
    pub attributes: HashMap<String, BinElAttr>,
    // some fields omitted
}

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 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_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

impl Send for BinEl

impl Sync for BinEl

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.