pub struct NodeDefaults {
pub flags: NodeFlags,
pub population: PopulationId,
pub individual: IndividualId,
}
Expand description
Defaults for node table rows without metadata
§Examples
let d = tskit::NodeDefaults::default();
assert_eq!(d.flags, tskit::NodeFlags::default());
assert_eq!(d.population, tskit::PopulationId::NULL);
assert_eq!(d.individual, tskit::IndividualId::NULL);
Struct update syntax is your friend here:
let d = tskit::NodeDefaults{population: 0.into(), ..Default::default()};
assert_eq!(d.flags, tskit::NodeFlags::default());
assert_eq!(d.population, 0);
assert_eq!(d.individual, tskit::IndividualId::NULL);
let d2 = tskit::NodeDefaults{flags: tskit::NodeFlags::default().mark_sample(),
// update remaining values from d
..d};
assert!(d2.flags.is_sample());
assert_eq!(d2.population, 0);
assert_eq!(d2.individual, tskit::IndividualId::NULL);
Fields§
§flags: NodeFlags
§population: PopulationId
§individual: IndividualId
Trait Implementations§
Source§impl Clone for NodeDefaults
impl Clone for NodeDefaults
Source§fn clone(&self) -> NodeDefaults
fn clone(&self) -> NodeDefaults
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NodeDefaults
impl Debug for NodeDefaults
Source§impl Default for NodeDefaults
impl Default for NodeDefaults
Source§fn default() -> NodeDefaults
fn default() -> NodeDefaults
Returns the “default value” for a type. Read more
Source§impl PartialEq for NodeDefaults
impl PartialEq for NodeDefaults
impl Copy for NodeDefaults
impl Eq for NodeDefaults
impl StructuralPartialEq for NodeDefaults
Auto Trait Implementations§
impl Freeze for NodeDefaults
impl RefUnwindSafe for NodeDefaults
impl Send for NodeDefaults
impl Sync for NodeDefaults
impl Unpin for NodeDefaults
impl UnwindSafe for NodeDefaults
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