use super::*;
impl<
G: SwhGraphWithProperties<LabelNames: properties::LabelNames>,
N: ContractionBackend,
MAPS: properties::MaybeMaps,
TIMESTAMPS: properties::MaybeTimestamps,
PERSONS: properties::MaybePersons,
CONTENTS: properties::MaybeContents,
STRINGS: properties::MaybeStrings,
>
ContiguousSubgraph<G, N, MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, properties::NoLabelNames>
{
pub fn with_label_names(
self,
) -> ContiguousSubgraph<
G,
N,
MAPS,
TIMESTAMPS,
PERSONS,
CONTENTS,
STRINGS,
ContiguousSubgraphLabelNames<G, N>,
> {
let ContiguousSubgraph {
properties:
properties::SwhGraphProperties {
path,
num_nodes,
maps,
timestamps,
persons,
contents,
strings,
label_names: properties::NoLabelNames,
label_names_are_in_base64_order,
},
inner,
} = self;
ContiguousSubgraph {
properties: properties::SwhGraphProperties {
path,
num_nodes,
maps,
timestamps,
persons,
contents,
strings,
label_names: ContiguousSubgraphLabelNames {
graph: Arc::clone(&inner),
},
label_names_are_in_base64_order,
},
inner,
}
}
}
pub struct ContiguousSubgraphLabelNames<
G: SwhGraphWithProperties<LabelNames: properties::LabelNames>,
N: ContractionBackend,
> {
graph: Arc<ContiguousSubgraphInner<G, N>>,
}
impl<G: SwhGraphWithProperties<LabelNames: properties::LabelNames>, N: ContractionBackend>
properties::LabelNames for ContiguousSubgraphLabelNames<G, N>
{
type LabelNames<'a>
= <<G as SwhGraphWithProperties>::LabelNames as properties::LabelNames>::LabelNames<'a>
where
Self: 'a;
fn label_names(&self) -> Self::LabelNames<'_> {
self.graph
.underlying_graph
.properties()
.label_names
.label_names()
}
}