IPLDSelector class
IPLD Selector for querying and traversing DAG structures.
Selectors define patterns for matching and extracting subsets of IPLD DAGs, used in Graphsync for efficient data transfer.
- Annotations
-
- @Deprecated('Use the official Selector vocabulary from selector_ast.dart')
Constructors
-
IPLDSelector({required SelectorType type, Map<
String, dynamic> criteria = const {}, int? maxDepth, List<IPLDSelector> ? subSelectors, String? fieldPath, bool? stopAtLink}) - Creates a selector with the given parameters.
- IPLDSelector.all()
-
Creates a selector that matches all nodes.
factory
- IPLDSelector.explore({required String path, required IPLDSelector selector})
-
Creates an explore selector for traversing a specific path.
factory
-
IPLDSelector.intersection(List<
IPLDSelector> selectors) -
Creates an intersection of multiple selectors.
factory
-
IPLDSelector.matcher({required Map<
String, dynamic> criteria}) -
Creates a matcher selector with the given criteria.
factory
- IPLDSelector.none()
-
Creates a selector that matches no nodes.
factory
- IPLDSelector.recursive({required IPLDSelector selector, int? maxDepth, bool stopAtLink = false})
-
Creates a recursive traversal selector.
factory
-
IPLDSelector.union(List<
IPLDSelector> selectors) -
Creates a union of multiple selectors.
factory
Properties
-
criteria
→ Map<
String, dynamic> -
Matching criteria for this selector.
final
- fieldPath → String?
-
Field path for explore selectors.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxDepth → int?
-
Maximum depth for recursive selectors.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stopAtLink → bool?
-
Whether to stop traversal at links.
final
-
subSelectors
→ List<
IPLDSelector> ? -
Child selectors for composite selectors.
final
- type → SelectorType
-
The selector type.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toBytes(
) → Future< Uint8List> - Converts the selector to IPLD bytes for Graphsync protocol
-
toSpecSelector(
) → Selector - Best-effort conversion to the official Selector vocabulary.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromBytesAsync(
Uint8List bytes) → Future< IPLDSelector> - Creates an IPLDSelector from its CBOR byte representation
-
fromNode(
IPLDNode node) → IPLDSelector - Creates an IPLDSelector from an IPLDNode