Skip to content

FaiView

Mojo struct 🡭

@memory_only
struct FaiView[O: Origin[mut=O.mut]]

Zero-copy view over one FAI index row in the parser’s buffer.

Lifetime: Valid only until the next parser read. Do not store in collections; call .to_record() to get an owned FaiRecord when the record must outlive the current iteration step.

  • O (Origin)

AnyType, ImplicitlyDestructible, Movable, Sized

def __init__(out self, _name: Span[UInt8, O], _length: Int64, _offset: Int64, _line_bases: Int64, _line_width: Int64, _qual_offset: Optional[Int64])

Args:

  • _name (Span)
  • _length (Int64)
  • _offset (Int64)
  • _line_bases (Int64)
  • _line_width (Int64)
  • _qual_offset (Optional)
  • self (Self)

Returns:

Self

def name(self) -> StringSlice[O]

Return the sequence name (valid only while view is valid).

Args:

  • self (Self)

Returns:

StringSlice

def length(self) -> Int64

Args:

  • self (Self)

Returns:

Int64

def offset(self) -> Int64

Args:

  • self (Self)

Returns:

Int64

def line_bases(self) -> Int64

Args:

  • self (Self)

Returns:

Int64

def line_width(self) -> Int64

Args:

  • self (Self)

Returns:

Int64

def qual_offset(self) -> Optional[Int64]

Args:

  • self (Self)

Returns:

Optional

def __len__(self) -> Int

Return the reference length as an Int.

Args:

  • self (Self)

Returns:

Int

def to_record(self) -> FaiRecord

Materialize an owned FaiRecord. Call when the record must outlive the view.

Args:

  • self (Self)

Returns:

FaiRecord