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, Deinitable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable

fn def __init__() -> Self

Returns:

_Self

fn def __init__(out 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

fn def __init__(out self, *, deinit move: Self)

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

Args:

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

Returns:

_Self

fn def classify(self, line: Span[UInt8]) -> LineAction

Args:

  • self (_Self)
  • line (Span[UInt8])

Returns:

LineAction

fn def copy(self) -> Self

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

Overriding this method is not allowed.

Args:

  • self (_Self)

Returns:

_Self: A copy of this value.