Struct oxyroot::ReaderTree

source ·
pub struct ReaderTree { /* private fields */ }
Expand description

Read only Rust equivalent of TTree

Mainly used to retrieve Branch and iterate on data.

Implementations§

source§

impl ReaderTree

source

pub fn branch(&self, name: &str) -> Option<&Branch>

Get a branch from this tree

source

pub fn branches(&self) -> impl Iterator<Item = &Branch>

Get iterator over top-level branches

source

pub fn entries(&self) -> i64

Number of entries in the TTree, as reported by fEntries.

source

pub fn branches_r(&self) -> Vec<&Branch>

Get all (recursively) branches in this tree

source

pub fn user_info(&self) -> Option<&ReaderList>

source

pub fn show(&self)

Display branches in this tree

Provide name, C++ type and a possible Rust interpretation.

Example:

name                           | typename                       | interpretation
-------------------------------+-------------------------------+-------------------------------
string                         | string                         | String
vector_vector_int32            | vector<vector<int32_t>>        | Vec<Vec<i32>>
vector_int32                   | vector<int32_t>                | Vec<i32>
vector_string                  | vector<string>                 | Vec<String>
three                          | char*                          | String

In this example, last branch can be read with:

let three = tree
        .branch("three")
        .unwrap()
        .as_iter::<String>()
        .collect::<Vec<_>>();

Trait Implementations§

source§

impl Default for ReaderTree

source§

fn default() -> ReaderTree

Returns the “default value” for a type. Read more
source§

impl Named for ReaderTree

source§

fn name(&self) -> &str

source§

fn title(&self) -> &str

source§

fn size_of(&self) -> i32

source§

impl Object for ReaderTree

source§

fn class(&self) -> &str

source§

impl Unmarshaler for ReaderTree

source§

fn unmarshal(&mut self, r: &mut RBuffer<'_>) -> Result<(), Error>

source§

fn class_name() -> Option<Vec<String>>
where Self: Sized,

Returns the kind of the type as C++ typename. Used to check if the type is supported.

Auto Trait Implementations§

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> Any for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

source§

fn type_name(&self) -> &'static str

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<'a, T> ReadFromTree<'a> for T
where T: UnmarshalerInto<Item = T> + 'a,

source§

fn from_branch_tree_sliced( tree: &'a ReaderTree, branch_name: BranchName ) -> Result<impl Iterator<Item = ReadFromTreeResult<T>>, Error>

this implementation exists to satisfy the compiler whcih need a concrete return type.

source§

fn from_branch_tree( tree: &'a ReaderTree, branch_name: BranchName ) -> Result<impl Iterator<Item = ReadFromTreeResult<T>>, Error>

source§

fn from_tree(tree: &'a ReaderTree) -> Result<impl Iterator<Item = Self>>
where Self: Sized,

source§

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

§

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

§

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.
source§

impl<T> UnmarshalerInto for T
where T: Default + Unmarshaler,

§

type Item = T

source§

fn unmarshal_into( r: &mut RBuffer<'_> ) -> Result<<T as UnmarshalerInto>::Item, Error>

source§

fn classe_name() -> Option<Vec<String>>