Slice class

A Slice selects the [from, to) subset of a string, bytes, or reified node inside a Matcher.

Negative values are offsets from the end of the node; an overflowing to clamps to the node length. A range that resolves to nothing (from >= to, or from >= length) fails to match.

Constructors

Slice({required int from, required int to})
const

Properties

from → int
final
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
to → int
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(int length) → (int, int)?
Resolves the slice against a length and returns (from, to), or null when the range fails to match. Mirrors go-ipld-prime sliceBounds.
toNode() → IPLDNode
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override