Struct El
pub(crate) struct El<'a, 'd>(pub(crate) Node<'a, 'd>);Expand description
An element, read by the local names of its children.
Tuple Fields§
§0: Node<'a, 'd>Implementations§
§impl<'a, 'd> El<'a, 'd>
impl<'a, 'd> El<'a, 'd>
pub(crate) fn name(self) -> &'a str
pub(crate) fn elements(self) -> impl Iterator<Item = El<'a, 'd>>
pub(crate) fn elements(self) -> impl Iterator<Item = El<'a, 'd>>
The element children, in document order.
pub(crate) fn child(self, name: &str) -> Option<El<'a, 'd>>
pub(crate) fn children(self, name: &'a str) -> impl Iterator<Item = El<'a, 'd>>
pub(crate) fn req(self, name: &str) -> Result<El<'a, 'd>, FpmlError>
pub(crate) fn descendants_named(self, name: &str) -> bool
pub(crate) fn descendants_named(self, name: &str) -> bool
Whether any element below this one is called name.
pub(crate) fn has(self, name: &str) -> bool
pub(crate) fn attr(self, name: &str) -> Option<&'a str>
pub(crate) fn text(self) -> &'a str
pub(crate) fn date(self) -> Result<NaiveDate, FpmlError>
pub(crate) fn decimal(self) -> Result<f64, FpmlError>
pub(crate) fn integer(self) -> Result<i32, FpmlError>
pub(crate) fn boolean(self) -> Result<bool, FpmlError>
pub(crate) fn parse<T: FromStr>(self) -> Result<T, FpmlError>
pub(crate) fn parse<T: FromStr>(self) -> Result<T, FpmlError>
A vocabulary value from the element’s text, the element named on refusal.
pub(crate) fn req_text(self, name: &str) -> Result<&'a str, FpmlError>
pub(crate) fn req_text(self, name: &str) -> Result<&'a str, FpmlError>
The child’s text, or a value error naming it.
pub(crate) fn bad_value(self, reason: &str) -> FpmlError
pub(crate) fn referenced(self, name: &str) -> Result<El<'a, 'd>, FpmlError>
pub(crate) fn referenced(self, name: &str) -> Result<El<'a, 'd>, FpmlError>
The child name, or the element {name}Reference points at through
its href, searched over the whole document by id.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'd> Freeze for El<'a, 'd>
impl<'a, 'd> RefUnwindSafe for El<'a, 'd>
impl<'a, 'd> Send for El<'a, 'd>
impl<'a, 'd> Sync for El<'a, 'd>
impl<'a, 'd> Unpin for El<'a, 'd>
impl<'a, 'd> UnsafeUnpin for El<'a, 'd>
impl<'a, 'd> UnwindSafe for El<'a, 'd>
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