Skip to content

LinePolicy

Mojo trait 🡭

Classify a raw line before it reaches the data-row path.

The DelimitedReader calls classify() on every line. The returned LineDisposition controls what happens next:

YIELD — hand the line to the field-splitting path as a normal row. SKIP — discard the line and advance. METADATA — route the line to handle_metadata() then advance. HEADER — parse the line as column names then advance. STOP — terminate iteration immediately (e.g. embedded FASTA block).

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable

def __init__() -> _Self

Returns:

_Self

def __init__(out self: _Self, *, copy: _Self)

Create a new instance of the value by copying an existing one.

Args:

  • copy (_Self): The value to copy.
  • self (_Self)

Returns:

_Self

def __init__(out self: _Self, *, deinit take: _Self)

Create a new instance of the value by moving the value of another.

Args:

  • take (_Self): The value to move.
  • self (_Self)

Returns:

_Self

def classify(self: _Self, line: Span[UInt8, line.origin]) -> LineAction

Args:

  • self (_Self)
  • line (Span)

Returns:

LineAction

def copy(self: _Self) -> _Self

Explicitly construct a copy of self, a convenience method for Self(copy=self) when the type is inconvenient to write out.

Args:

  • self (_Self)

Returns:

_Self: A copy of this value.