pub struct ClientMetadata {
pub catalog: TreeNode,
pub structural_patterns: Vec<StructuralPattern>,
pub index_set_patterns: Vec<IndexSetPattern>,
/* private fields */
}Expand description
Metadata extracted from brk_query for client generation.
Fields§
§catalog: TreeNodeThe catalog tree structure (with schemas in leaves)
structural_patterns: Vec<StructuralPattern>Structural patterns - tree node shapes that repeat
index_set_patterns: Vec<IndexSetPattern>Index set patterns - sets of indexes that appear together on series
Implementations§
Source§impl ClientMetadata
impl ClientMetadata
Sourcepub fn from_catalog(catalog: TreeNode) -> Self
pub fn from_catalog(catalog: TreeNode) -> Self
Extract metadata from a catalog TreeNode directly.
Sourcepub fn find_index_set_pattern(
&self,
indexes: &BTreeSet<Index>,
) -> Option<&IndexSetPattern>
pub fn find_index_set_pattern( &self, indexes: &BTreeSet<Index>, ) -> Option<&IndexSetPattern>
Find an index set pattern that matches the given indexes.
Sourcepub fn find_pattern(&self, name: &str) -> Option<&StructuralPattern>
pub fn find_pattern(&self, name: &str) -> Option<&StructuralPattern>
Find a pattern by name.
Sourcepub fn is_parameterizable(&self, name: &str) -> bool
pub fn is_parameterizable(&self, name: &str) -> bool
Check if a pattern is fully parameterizable (recursively). Returns false if the pattern or any nested branch pattern has no mode.
Sourcepub fn find_pattern_by_fields(
&self,
fields: &[PatternField],
) -> Option<&StructuralPattern>
pub fn find_pattern_by_fields( &self, fields: &[PatternField], ) -> Option<&StructuralPattern>
Find a pattern by its concrete fields.
Sourcepub fn get_type_param(&self, fields: &[PatternField]) -> Option<&String>
pub fn get_type_param(&self, fields: &[PatternField]) -> Option<&String>
Get the type parameter for a generic pattern given its concrete fields.
Sourcepub fn pattern_lookup(&self) -> &BTreeMap<Vec<PatternField>, String>
pub fn pattern_lookup(&self) -> &BTreeMap<Vec<PatternField>, String>
Get the pre-computed pattern lookup map.
Sourcepub fn get_node_base(&self, path: &str) -> Option<&PatternBaseResult>
pub fn get_node_base(&self, path: &str) -> Option<&PatternBaseResult>
Get the pre-computed PatternBaseResult for a tree path.
Sourcepub fn field_type_annotation(
&self,
field: &PatternField,
is_generic: bool,
generic_value_type: Option<&str>,
syntax: GenericSyntax,
) -> String
pub fn field_type_annotation( &self, field: &PatternField, is_generic: bool, generic_value_type: Option<&str>, syntax: GenericSyntax, ) -> String
Generate type annotation for a field with language-specific syntax.
Sourcepub fn field_type_annotation_from_leaf(
&self,
leaf: &SeriesLeafWithSchema,
syntax: GenericSyntax,
) -> String
pub fn field_type_annotation_from_leaf( &self, leaf: &SeriesLeafWithSchema, syntax: GenericSyntax, ) -> String
Generate type annotation for a leaf node with language-specific syntax.
This is a simpler version of field_type_annotation that works directly
with a SeriesLeafWithSchema node instead of a PatternField.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientMetadata
impl RefUnwindSafe for ClientMetadata
impl Send for ClientMetadata
impl Sync for ClientMetadata
impl Unpin for ClientMetadata
impl UnsafeUnpin for ClientMetadata
impl UnwindSafe for ClientMetadata
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> 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 more