Skip to main content

FoNode

Struct FoNode 

Source
pub struct FoNode<'a> {
    pub data: FoNodeData<'a>,
    pub id: Option<String>,
    pub parent: Option<NodeId>,
    pub first_child: Option<NodeId>,
    pub next_sibling: Option<NodeId>,
}
Expand description

A node in the FO tree

Fields§

§data: FoNodeData<'a>

The FO data for this node

§id: Option<String>

Optional element ID for cross-references and linking Per XSL-FO spec section 5.2.2, the “id” property uniquely identifies an element

§parent: Option<NodeId>

Parent node ID (None for root)

§first_child: Option<NodeId>

First child node ID

§next_sibling: Option<NodeId>

Next sibling node ID

Implementations§

Source§

impl<'a> FoNode<'a>

Source

pub fn new(data: FoNodeData<'a>) -> Self

Create a new node with the given data

Source

pub fn new_with_id(data: FoNodeData<'a>, id: Option<String>) -> Self

Create a new node with the given data and ID

Source

pub fn id(&self) -> Option<&str>

Get the element ID if present

Source

pub fn set_id(&mut self, id: Option<String>)

Set the element ID

Source

pub fn has_children(&self) -> bool

Check if this node has children

Source

pub fn is_root(&self) -> bool

Check if this node is a root node

Auto Trait Implementations§

§

impl<'a> !Freeze for FoNode<'a>

§

impl<'a> !RefUnwindSafe for FoNode<'a>

§

impl<'a> !Send for FoNode<'a>

§

impl<'a> !Sync for FoNode<'a>

§

impl<'a> Unpin for FoNode<'a>

§

impl<'a> UnsafeUnpin for FoNode<'a>

§

impl<'a> !UnwindSafe for FoNode<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.