#[repr(transparent)]pub struct EdgeTable { /* private fields */ }
Expand description
An immutable view of an edge table.
These are not created directly but are accessed
by types implementing std::ops::Deref
to
crate::table_views::TableViews
Implementations
sourceimpl EdgeTable
impl EdgeTable
sourcepub fn parent<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<NodeId>
pub fn parent<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<NodeId>
Return the parent
value from row row
of the table.
Returns
Some(parent)
ifu
is valid.None
otherwise.
sourcepub fn child<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<NodeId>
pub fn child<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<NodeId>
Return the child
value from row row
of the table.
Returns
Some(child)
ifu
is valid.None
otherwise.
sourcepub fn left<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<Position>
pub fn left<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<Position>
Return the left
value from row row
of the table.
Returns
Some(position)
ifu
is valid.None
otherwise.
sourcepub fn right<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<Position>
pub fn right<E: Into<EdgeId> + Copy>(&self, row: E) -> Option<Position>
Return the right
value from row row
of the table.
Returns
Some(position)
ifu
is valid.None
otherwise.
sourcepub fn metadata<T: EdgeMetadata>(
&self,
row: EdgeId
) -> Option<Result<T, TskitError>>
pub fn metadata<T: EdgeMetadata>(
&self,
row: EdgeId
) -> Option<Result<T, TskitError>>
Retrieve decoded metadata for a row
.
Returns
Some(Ok(T))
ifrow
is valid and decoding succeeded.Some(Err(_))
ifrow
is not valid and decoding failed.None
ifrow
is not valid.
Errors
TskitError::MetadataError
if decoding fails.
Examples.
The big-picture semantics are the same for all table types.
See crate::IndividualTable::metadata
for examples.
sourcepub fn iter(&self) -> impl Iterator<Item = EdgeTableRow> + '_
pub fn iter(&self) -> impl Iterator<Item = EdgeTableRow> + '_
Return an iterator over rows of the table.
The value of the iterator is EdgeTableRow
.
Auto Trait Implementations
impl RefUnwindSafe for EdgeTable
impl !Send for EdgeTable
impl !Sync for EdgeTable
impl Unpin for EdgeTable
impl UnwindSafe for EdgeTable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more