pub struct Relationships {
pub by_id: HashMap<String, Relationship>,
pub by_type: HashMap<String, Vec<Relationship>>,
}Expand description
Collection of relationships parsed from a .rels file.
Fields§
§by_id: HashMap<String, Relationship>Map from relationship ID to relationship data
by_type: HashMap<String, Vec<Relationship>>Map from relationship type to list of relationships
Implementations§
Source§impl Relationships
impl Relationships
Sourcepub fn get(&self, id: &str) -> Option<&Relationship>
pub fn get(&self, id: &str) -> Option<&Relationship>
Get a relationship by ID.
Sourcepub fn get_by_type(&self, rel_type: &str) -> Vec<&Relationship>
pub fn get_by_type(&self, rel_type: &str) -> Vec<&Relationship>
Get relationships by type.
Sourcepub fn add(&mut self, rel: Relationship)
pub fn add(&mut self, rel: Relationship)
Add a relationship.
Sourcepub fn into_targets_by_id(self) -> HashMap<String, String>
pub fn into_targets_by_id(self) -> HashMap<String, String>
Consume the collection into an ID → target map.
Trait Implementations§
Source§impl Clone for Relationships
impl Clone for Relationships
Source§fn clone(&self) -> Relationships
fn clone(&self) -> Relationships
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Relationships
impl Debug for Relationships
Source§impl Default for Relationships
impl Default for Relationships
Source§fn default() -> Relationships
fn default() -> Relationships
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Relationships
impl RefUnwindSafe for Relationships
impl Send for Relationships
impl Sync for Relationships
impl Unpin for Relationships
impl UnsafeUnpin for Relationships
impl UnwindSafe for Relationships
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