Struct hpo::term::HpoTerm

source ·
pub struct HpoTerm<'a> { /* private fields */ }
Expand description

The HpoTerm represents a single term from the HP Ontology

The term holds all required information and relationship data. It provides functionality for path traversals and similarity calculations.

Implementations§

source§

impl<'a> HpoTerm<'a>

source

pub fn try_new<I: Into<HpoTermId>>( ontology: &'a Ontology, term: I ) -> HpoResult<HpoTerm<'a>>

Constructs a new HpoTerm

§Errors

If the given HpoTermId does not match an existing term it returns an Error

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = HpoTerm::try_new(&ontology, 118u32);
assert!(term.is_ok());

let non_existing_term = HpoTerm::try_new(&ontology, 666666666u32);
assert!(non_existing_term.is_err());
source

pub fn id(&self) -> HpoTermId

Returns the HpoTermId of the term

e.g.: HP:0012345

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(118u32).unwrap();
assert_eq!(term.id(), "HP:0000118");
source

pub fn name(&self) -> &str

Returns the name of the term

e.g.: Abnormality of the nervous system

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(118u32).unwrap();
assert_eq!(term.name(), "Phenotypic abnormality");
source

pub fn parent_ids(&self) -> &HpoGroup

Returns the HpoTermIds of the direct parents

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(11017u32).unwrap();
assert_eq!(term.parent_ids().len(), 1);
source

pub fn parents(&self) -> Iter<'a>

Returns an iterator of the direct patients of the term

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(11017u32).unwrap();
assert_eq!(term.parents().count(), 1);
for parent in term.parents() {
   println!("{}", parent.name());
}
source

pub fn all_parent_ids(&self) -> &HpoGroup

Returns the HpoTermIds of all direct and indirect parents

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(11017u32).unwrap();
assert_eq!(term.all_parent_ids().len(), 3);
source

pub fn all_parents(&self) -> Iter<'a>

Returns an iterator of the direct and indirect parents of the term

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(11017u32).unwrap();
assert_eq!(term.all_parents().count(), 3);
for parent in term.all_parents() {
   println!("{}", parent.name());
}
source

pub fn children_ids(&self) -> &HpoGroup

Returns the HpoTermIds of the direct children

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(1939u32).unwrap();
assert_eq!(term.children_ids().len(), 2);
source

pub fn children(&self) -> Iter<'a>

Returns an iterator of the direct children of the term

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(1939u32).unwrap();
for child in term.children() {
   println!("{}", child.name());
}
source

pub fn all_common_ancestor_ids(&self, other: &HpoTerm<'_>) -> HpoGroup

Returns the HpoTermIds that are parents of both self and other

§Note:

This method includes self and other into their corresponding parent-id list so that if one term is a parent term of the other, it is included. It also means that self is included if self == other.

This might seem counter-intuitive at first, but in most cases this is what is actually needed

§Examples
§Note:

Check out the crate::Ontology documentation to see the example ontology

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(25454u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let common_ancestors = term1.all_common_ancestor_ids(&term2);
assert_eq!(common_ancestors.len(), 3);

assert!(!common_ancestors.contains(&11017u32.into()));
assert!(!common_ancestors.contains(&25454u32.into()));
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let common_ancestors = term1.all_common_ancestor_ids(&term2);
assert_eq!(common_ancestors.len(), 3);

assert!(!common_ancestors.contains(&11017u32.into()));
assert!(common_ancestors.contains(&1939u32.into()));
source

pub fn common_ancestor_ids(&self, other: &HpoTerm<'_>) -> HpoGroup

Returns the HpoTermIds that are parents of both self and other

§Note:

This method does not include self and other. Depending on your use case, you might prefer HpoTerm::all_common_ancestor_ids.

§Examples
§Note:

Check out the crate::Ontology documentation to see the example ontology

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(25454u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let common_ancestors = term1.common_ancestor_ids(&term2);
assert_eq!(common_ancestors.len(), 3);

assert!(!common_ancestors.contains(&11017u32.into()));
assert!(!common_ancestors.contains(&25454u32.into()));
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let common_ancestors = term1.common_ancestor_ids(&term2);
assert_eq!(common_ancestors.len(), 2);

assert!(!common_ancestors.contains(&11017u32.into()));
assert!(!common_ancestors.contains(&1939u32.into()));
source

pub fn all_union_ancestor_ids(&self, other: &HpoTerm<'_>) -> HpoGroup

Returns the HpoTermIds that are parents of either self or other

§Note:

This method includes self and other into their corresponding parent-id list so that both are included themselves as well.

This might seem counter-intuitive at first, but in many cases this is what is actually needed

§Examples
§Note:

Check out the crate::Ontology documentation to see the example ontology

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(12639u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let union_ancestors = term1.all_union_ancestor_ids(&term2);
assert_eq!(union_ancestors.len(), 4);

assert!(!union_ancestors.contains(&11017u32.into()));
assert!(!union_ancestors.contains(&12639u32.into()));
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let union_ancestors = term1.all_union_ancestor_ids(&term2);
assert_eq!(union_ancestors.len(), 3);

assert!(!union_ancestors.contains(&11017u32.into()));
assert!(union_ancestors.contains(&1939u32.into()));
source

pub fn union_ancestor_ids(&self, other: &HpoTerm<'_>) -> HpoGroup

Returns the HpoTermIds that are parents of either self or other

§Examples
§Note:

Check out the crate::Ontology documentation to see the example ontology

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(12639u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let union_ancestors = term1.all_union_ancestor_ids(&term2);
assert_eq!(union_ancestors.len(), 4);

assert!(!union_ancestors.contains(&11017u32.into()));
assert!(!union_ancestors.contains(&12639u32.into()));
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let union_ancestors = term1.all_union_ancestor_ids(&term2);
assert_eq!(union_ancestors.len(), 3);

assert!(!union_ancestors.contains(&11017u32.into()));
assert!(union_ancestors.contains(&1939u32.into()));
source

pub fn all_common_ancestors(&self, other: &HpoTerm<'_>) -> Combined<'_>

Returns an iterator of HpoTerms that are parents of both self and other

§Note:

This method includes self and other into their corresponding parent-id list so that if one term is a parent term of the other, it is included. It also means that self is included if self == other.

This might seem counter-intuitive at first, but in most cases this is what is actually needed

§Examples
§Note:

Check out the crate::Ontology documentation to see the example ontology

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(25454u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let common_ancestors = term1.all_common_ancestors(&term2);
assert_eq!(common_ancestors.len(), 3);

for term in &common_ancestors {
    println!("{}", term.name());
}
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let common_ancestors = term1.all_common_ancestors(&term2);
assert_eq!(common_ancestors.len(), 3);

for term in &common_ancestors {
    println!("{}", term.name());
}
source

pub fn common_ancestors(&self, other: &HpoTerm<'_>) -> Combined<'_>

Returns an iterator of HpoTerms that are parents of both self and other

§Note:

This method does not include self and other. Depending on your use case, you might prefer [HpoTerm.all_common_ancestor_ids].

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(25454u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let common_ancestors = term1.common_ancestors(&term2);
assert_eq!(common_ancestors.len(), 3);

for term in &common_ancestors {
    println!("{}", term.name());
}
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let common_ancestors = term1.common_ancestors(&term2);
assert_eq!(common_ancestors.len(), 2);

for term in &common_ancestors {
    println!("{}", term.name());
}
source

pub fn all_union_ancestors(&self, other: &HpoTerm<'_>) -> Combined<'_>

Returns an iterator of HpoTerms that are parents of either self or other

§Note:

This method includes self and other into their corresponding parent-id list so that both are included themselves as well.

This might seem counter-intuitive at first, but in many cases this is what is actually needed

§Examples
§Note:

Check out the crate::Ontology documentation to see the example ontology

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(12639u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let union_ancestors = term1.all_union_ancestors(&term2);
assert_eq!(union_ancestors.len(), 4);

for term in &union_ancestors {
    println!("{}", term.name());
}
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let union_ancestors = term1.all_union_ancestors(&term2);
assert_eq!(union_ancestors.len(), 3);

for term in &union_ancestors {
    println!("{}", term.name());
}
source

pub fn union_ancestors(&self, other: &HpoTerm<'_>) -> Combined<'_>

Returns an iterator of HpoTerms that are parents of either self or other

§Examples
§Note:

Check out the crate::Ontology documentation to see the example ontology

§Test-case 1: Terms do not have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(12639u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(!term2.parent_of(&term1));

let union_ancestors = term1.union_ancestors(&term2);
assert_eq!(union_ancestors.len(), 4);

for term in &union_ancestors {
    println!("{}", term.name());
}
§Test-case 2: Terms do have a parent - child relationship
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(1939u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));

let union_ancestors = term1.union_ancestors(&term2);
assert_eq!(union_ancestors.len(), 3);

for term in &union_ancestors {
    println!("{}", term.name());
}
source

pub fn genes(&self) -> GeneIterator<'a>

Returns an iterator of all associated crate::annotations::Genes

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(11017u32).unwrap();
for gene in term.genes() {
    println!("{}", gene.name());
}
source

pub fn gene_ids(&self) -> &Genes

Returns the set of all associated crate::annotations::Genes

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(11017u32).unwrap();
assert_eq!(term.gene_ids().len(), 575);
source

pub fn omim_diseases(&self) -> OmimDiseaseIterator<'a>

Returns an iterator of all associated crate::annotations::OmimDiseases

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(11017u32).unwrap();
for disease in term.omim_diseases() {
    println!("{}", disease.name());
}
source

pub fn omim_disease_ids(&self) -> &OmimDiseases

Returns the set of all associated crate::annotations::OmimDiseases

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(1939u32).unwrap();
assert_eq!(term.omim_disease_ids().len(), 143);
source

pub fn information_content(&self) -> &InformationContent

Returns the InformationContent of the term

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term = ontology.hpo(1939u32).unwrap();
let ic = term.information_content();
assert_eq!(ic.gene(), 0.6816717);
assert_eq!(ic.omim_disease(), 3.4335358);
source

pub fn similarity_score( &self, other: &HpoTerm<'_>, similarity: &impl Similarity ) -> f32

Calculates the similarity of self and other using the provided Similarity algorithm

§Examples
use hpo::{HpoTerm, Ontology};
use hpo::similarity::Builtins;
use hpo::term::InformationContentKind;

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(11017u32).unwrap();
let term2 = ontology.hpo(12639u32).unwrap();

let sim = term1.similarity_score(&term2, &Builtins::GraphIc(InformationContentKind::Omim));
assert_eq!(sim, 0.2765914);
source

pub fn distance_to_ancestor(&self, other: &HpoTerm<'_>) -> Option<usize>

Returns the distance (steps) from self to other, if other is a parent of self

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(25454u32).unwrap();
let term2 = ontology.hpo(118u32).unwrap();
let term3 = ontology.hpo(12639u32).unwrap();

assert_eq!(term1.distance_to_ancestor(&term2), Some(2));
assert_eq!(term2.distance_to_ancestor(&term1), None);
assert_eq!(term1.distance_to_ancestor(&term3), None);
source

pub fn child_of(&self, other: &HpoTerm<'_>) -> bool

Returns true if self is a child (direct or indirect) of other

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(25454u32).unwrap();
let term2 = ontology.hpo(118u32).unwrap();

assert!(term1.child_of(&term2));
assert!(!term2.child_of(&term1));
source

pub fn parent_of(&self, other: &HpoTerm<'_>) -> bool

Returns true if self is a parent (direct or indirect) of other

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(25454u32).unwrap();
let term2 = ontology.hpo(118u32).unwrap();

assert!(!term1.parent_of(&term2));
assert!(term2.parent_of(&term1));
source

pub fn path_to_ancestor(&self, other: &HpoTerm<'_>) -> Option<Vec<HpoTermId>>

Returns the shortest path to traverse from self to other, if other is a parent of self

§Examples
use hpo::{HpoTerm, HpoTermId, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(25454u32).unwrap();
let term2 = ontology.hpo(118u32).unwrap();

assert_eq!(
    term1.path_to_ancestor(&term2).unwrap(),
    vec![
        HpoTermId::try_from("HP:0001939").unwrap(),
        HpoTermId::try_from("HP:0000118").unwrap()
    ]
);
assert_eq!(term2.path_to_ancestor(&term1), None);
source

pub fn distance_to_term(&self, other: &HpoTerm<'_>) -> Option<usize>

Returns the distance (steps) from self to other

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(25454u32).unwrap();
let term2 = ontology.hpo(118u32).unwrap();
let term3 = ontology.hpo(12639u32).unwrap();

assert_eq!(term1.distance_to_term(&term2), Some(2));
assert_eq!(term2.distance_to_term(&term1), Some(2));
assert_eq!(term1.distance_to_term(&term3), Some(4));
source

pub fn path_to_term(&self, other: &HpoTerm<'_>) -> Option<Vec<HpoTermId>>

Returns the shortest path to traverse from self to other

This method is not optimized for performance

§Examples
use hpo::{HpoTerm, Ontology, HpoTermId};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let term1 = ontology.hpo(25454u32).unwrap();
let term3 = ontology.hpo(12639u32).unwrap();

assert_eq!(
    term1.path_to_term(&term3).unwrap(),
    vec![
        HpoTermId::try_from("HP:0001939").unwrap(),
        HpoTermId::try_from("HP:0000118").unwrap(),
        HpoTermId::try_from("HP:0000707").unwrap(),
        HpoTermId::try_from("HP:0012639").unwrap()
    ]
);
§Panics

TODO

source

pub fn is_obsolete(&self) -> bool

Returns true if the term is flagged as obsolete

source

pub fn replaced_by(&self) -> Option<HpoTerm<'a>>

Returns the replacement term, if it exists

Returns None otherwise

If a term has multiple replaced_by annotations only one annotation is selected as replacement. Usually the last one, if parsing from an obo file.

source

pub fn replacement_id(&self) -> Option<HpoTermId>

Returns the HpoTermId of an replacement term, if it exists

Returns None otherwise

If a term has multiple replaced_by annotations only one annotation is selected as replacement. Usually the last one, if parsing from an obo file.

source

pub fn is_modifier(&self) -> bool

Returns true if the term is a descendent of a modifier root term

§Examples
use hpo::{HpoTerm, Ontology};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let mendelian_inheritance = ontology.hpo(34345u32).unwrap();
let adult_onset = ontology.hpo(3581u32).unwrap();
let abnormal_forebrain_morphology = ontology.hpo(100547u32).unwrap();

assert!(mendelian_inheritance.is_modifier());
assert!(adult_onset.is_modifier());
assert!(!abnormal_forebrain_morphology.is_modifier());
source

pub fn categories(&self) -> Vec<HpoTermId>

Returns the category of the term, or None if uncategorized

Categories are defined in Ontology::set_default_categories()

The default implementation ensures that each term is categorized in exactly one category, but this can be modified on the Ontology level. If a term might be part of multiple categories, one is (semi-)randomly selected.

§Examples
use hpo::{HpoTerm, Ontology, HpoTermId};

let ontology = Ontology::from_binary("tests/example.hpo").unwrap();

let mendelian_inheritance = ontology.hpo(HpoTermId::from_u32(34345)).unwrap();
let adult_onset = ontology.hpo(HpoTermId::from_u32(3581)).unwrap();
let abnormal_hypothalamus_physiology = ontology.hpo(HpoTermId::from_u32(12285)).unwrap();

assert_eq!(mendelian_inheritance.categories(), vec![HpoTermId::from_u32(5)]);
assert_eq!(adult_onset.categories(), vec![HpoTermId::from_u32(12823)]);
assert_eq!(abnormal_hypothalamus_physiology.categories(), vec![HpoTermId::from_u32(707), HpoTermId::from_u32(818)]);

Trait Implementations§

source§

impl<'a> Clone for HpoTerm<'a>

source§

fn clone(&self) -> HpoTerm<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for HpoTerm<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'b, 'a> Extend<HpoTerm<'b>> for HpoSet<'a>

source§

fn extend<T: IntoIterator<Item = HpoTerm<'b>>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<'a> FromIterator<HpoTerm<'a>> for HpoGroup

source§

fn from_iter<T: IntoIterator<Item = HpoTerm<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl PartialEq for HpoTerm<'_>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Copy for HpoTerm<'a>

source§

impl Eq for HpoTerm<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for HpoTerm<'a>

§

impl<'a> RefUnwindSafe for HpoTerm<'a>

§

impl<'a> Send for HpoTerm<'a>

§

impl<'a> Sync for HpoTerm<'a>

§

impl<'a> Unpin for HpoTerm<'a>

§

impl<'a> UnwindSafe for HpoTerm<'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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,