pub struct KnowledgeGraph {
pub relationship_hierarchy: Option<RelationshipHierarchy>,
/* private fields */
}Expand description
Knowledge graph containing entities and their relationships
Fields§
§relationship_hierarchy: Option<RelationshipHierarchy>Hierarchical organization of relationships (Phase 3.1)
Implementations§
Source§impl KnowledgeGraph
impl KnowledgeGraph
Sourcepub fn new() -> KnowledgeGraph
pub fn new() -> KnowledgeGraph
Create a new empty knowledge graph
Sourcepub fn add_document(&mut self, document: Document) -> Result<(), GraphRAGError>
pub fn add_document(&mut self, document: Document) -> Result<(), GraphRAGError>
Add a document to the knowledge graph
Sourcepub fn add_entity(&mut self, entity: Entity) -> Result<NodeIndex, GraphRAGError>
pub fn add_entity(&mut self, entity: Entity) -> Result<NodeIndex, GraphRAGError>
Add an entity to the knowledge graph
Sourcepub fn add_relationship(
&mut self,
relationship: Relationship,
) -> Result<(), GraphRAGError>
pub fn add_relationship( &mut self, relationship: Relationship, ) -> Result<(), GraphRAGError>
Add a relationship between entities
Sourcepub fn add_chunk(&mut self, chunk: TextChunk) -> Result<(), GraphRAGError>
pub fn add_chunk(&mut self, chunk: TextChunk) -> Result<(), GraphRAGError>
Add a chunk to the knowledge graph
Sourcepub fn get_entity(&self, id: &EntityId) -> Option<&Entity>
pub fn get_entity(&self, id: &EntityId) -> Option<&Entity>
Get an entity by ID
Sourcepub fn get_document(&self, id: &DocumentId) -> Option<&Document>
pub fn get_document(&self, id: &DocumentId) -> Option<&Document>
Get a document by ID
Sourcepub fn get_entity_mut(&mut self, id: &EntityId) -> Option<&mut Entity>
pub fn get_entity_mut(&mut self, id: &EntityId) -> Option<&mut Entity>
Get a mutable reference to an entity by ID
Sourcepub fn get_chunk_mut(&mut self, id: &ChunkId) -> Option<&mut TextChunk>
pub fn get_chunk_mut(&mut self, id: &ChunkId) -> Option<&mut TextChunk>
Get a mutable reference to a chunk by ID
Sourcepub fn entities_mut(&mut self) -> impl Iterator<Item = &mut Entity>
pub fn entities_mut(&mut self) -> impl Iterator<Item = &mut Entity>
Get all entities (mutable)
Sourcepub fn documents_mut(&mut self) -> impl Iterator<Item = &mut Document>
pub fn documents_mut(&mut self) -> impl Iterator<Item = &mut Document>
Get all documents (mutable)
Sourcepub fn chunks_mut(&mut self) -> impl Iterator<Item = &mut TextChunk>
pub fn chunks_mut(&mut self) -> impl Iterator<Item = &mut TextChunk>
Get all chunks (mutable)
Sourcepub fn get_neighbors(
&self,
entity_id: &EntityId,
) -> Vec<(&Entity, &Relationship)>
pub fn get_neighbors( &self, entity_id: &EntityId, ) -> Vec<(&Entity, &Relationship)>
Get neighbors of an entity
Sourcepub fn get_all_relationships(&self) -> Vec<&Relationship>
pub fn get_all_relationships(&self) -> Vec<&Relationship>
Get all relationships in the graph
Sourcepub fn load_from_json(file_path: &str) -> Result<KnowledgeGraph, GraphRAGError>
pub fn load_from_json(file_path: &str) -> Result<KnowledgeGraph, GraphRAGError>
Load knowledge graph from JSON file
Sourcepub fn save_to_json(&self, file_path: &str) -> Result<(), GraphRAGError>
pub fn save_to_json(&self, file_path: &str) -> Result<(), GraphRAGError>
Save knowledge graph to JSON file with optimized format for entities and relationships
Sourcepub fn find_entities_by_name(&self, name: &str) -> impl Iterator<Item = &Entity>
pub fn find_entities_by_name(&self, name: &str) -> impl Iterator<Item = &Entity>
Find entities by name (case-insensitive partial match)
Sourcepub fn get_entity_by_id(&self, id: &str) -> Option<&Entity>
pub fn get_entity_by_id(&self, id: &str) -> Option<&Entity>
Get entity by ID (string version for compatibility)
Sourcepub fn get_entity_relationships(
&self,
entity_id: &str,
) -> impl Iterator<Item = &Relationship>
pub fn get_entity_relationships( &self, entity_id: &str, ) -> impl Iterator<Item = &Relationship>
Get entity relationships
Sourcepub fn find_relationship_path(
&self,
entity1: &str,
entity2: &str,
_max_depth: usize,
) -> Vec<String>
pub fn find_relationship_path( &self, entity1: &str, entity2: &str, _max_depth: usize, ) -> Vec<String>
Find relationship path between two entities (simplified BFS)
Sourcepub fn build_pagerank_calculator(
&self,
) -> Result<PersonalizedPageRank, GraphRAGError>
pub fn build_pagerank_calculator( &self, ) -> Result<PersonalizedPageRank, GraphRAGError>
Build PageRank calculator from current graph structure Only available when pagerank feature is enabled
Sourcepub fn entity_count(&self) -> usize
pub fn entity_count(&self) -> usize
Count entities in the graph
Sourcepub fn relationship_count(&self) -> usize
pub fn relationship_count(&self) -> usize
Count relationships in the graph
Sourcepub fn document_count(&self) -> usize
pub fn document_count(&self) -> usize
Count documents in the graph
Sourcepub fn relationships(&self) -> impl Iterator<Item = &Relationship>
pub fn relationships(&self) -> impl Iterator<Item = &Relationship>
Get all relationships as an iterator
Sourcepub fn clear_entities_and_relationships(&mut self)
pub fn clear_entities_and_relationships(&mut self)
Clear all entities and relationships while preserving documents and chunks
This is useful for rebuilding the graph from scratch without reloading documents.
Sourcepub fn dynamic_weight(
&self,
relationship: &Relationship,
query_embedding: Option<&[f32]>,
query_concepts: &[String],
) -> f32
pub fn dynamic_weight( &self, relationship: &Relationship, query_embedding: Option<&[f32]>, query_concepts: &[String], ) -> f32
Calculate dynamic weight for a relationship based on query context (Phase 2.2)
Combines multiple factors:
- Base weight: relationship.confidence
- Semantic boost: similarity between relationship and query embeddings
- Temporal boost: relevance of temporal range
- Conceptual boost: matching query concepts in relationship type
§Arguments
relationship- The relationship to weightquery_embedding- Optional embedding vector for the queryquery_concepts- Concepts extracted from the query
§Returns
Dynamic weight value (typically 0.0-2.0, can be higher with strong matches)
Sourcepub fn to_leiden_graph(&self) -> Graph<String, f32, Undirected>
pub fn to_leiden_graph(&self) -> Graph<String, f32, Undirected>
Convert KnowledgeGraph to petgraph format for Leiden clustering Returns a graph with entity names as nodes and relationship confidences as edge weights Only available when leiden feature is enabled
Sourcepub fn detect_hierarchical_communities(
&self,
config: LeidenConfig,
) -> Result<HierarchicalCommunities, GraphRAGError>
pub fn detect_hierarchical_communities( &self, config: LeidenConfig, ) -> Result<HierarchicalCommunities, GraphRAGError>
Detect hierarchical communities in the entity graph using Leiden algorithm Only available when leiden feature is enabled
§Arguments
config- Leiden algorithm configuration
§Returns
HierarchicalCommunities structure with community assignments at each level
§Example
use graphrag_core::{KnowledgeGraph, graph::LeidenConfig};
let graph = KnowledgeGraph::new();
// ... build graph ...
let config = LeidenConfig {
max_cluster_size: 10,
resolution: 1.0,
..Default::default()
};
let communities = graph.detect_hierarchical_communities(config).unwrap();Sourcepub async fn build_relationship_hierarchy(
&mut self,
num_levels: usize,
ollama_client: Option<OllamaClient>,
) -> Result<(), GraphRAGError>
pub async fn build_relationship_hierarchy( &mut self, num_levels: usize, ollama_client: Option<OllamaClient>, ) -> Result<(), GraphRAGError>
Build hierarchical organization of relationships (Phase 3.1)
Creates multi-level clusters of relationships using recursive community detection and LLM-generated summaries for efficient retrieval.
§Arguments
num_levels- Number of hierarchy levels to create (default: 3)ollama_client- Optional Ollama client for generating cluster summaries
§Returns
Result containing the built hierarchy or an error
§Example
use graphrag_core::{KnowledgeGraph, ollama::OllamaClient};
let mut graph = KnowledgeGraph::new();
// ... build graph ...
let ollama = OllamaClient::new("http://localhost:11434", "llama3.2");
graph.build_relationship_hierarchy(3, Some(ollama)).await.unwrap();Trait Implementations§
Source§impl Clone for KnowledgeGraph
impl Clone for KnowledgeGraph
Source§fn clone(&self) -> KnowledgeGraph
fn clone(&self) -> KnowledgeGraph
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KnowledgeGraph
impl Debug for KnowledgeGraph
Source§impl Default for KnowledgeGraph
impl Default for KnowledgeGraph
Source§fn default() -> KnowledgeGraph
fn default() -> KnowledgeGraph
Auto Trait Implementations§
impl Freeze for KnowledgeGraph
impl RefUnwindSafe for KnowledgeGraph
impl Send for KnowledgeGraph
impl Sync for KnowledgeGraph
impl Unpin for KnowledgeGraph
impl UnsafeUnpin for KnowledgeGraph
impl UnwindSafe for KnowledgeGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.