Search results

There are no results.

std.csv.Error

type pub inline Error[E]

An error produced when parsing a CSV stream.

Fields

kind

let pub @kind: ErrorKind[E]

The kind of error that's produced.

offset

let pub @offset: Int

The byte offset at which the error is produced.

Instance methods

!=

Show source code
Hide source code
fn pub !=(other: ref Self) -> Bool {
  (self == other).false?
}
fn pub !=(other: ref Self) -> Bool
if
  E: Equal

Returns true if self and the given object are not equal to each other.

==

Show source code
Hide source code
fn pub ==(other: ref Error[E]) -> Bool {
  @kind == other.kind and @offset == other.offset
}
fn pub ==(other: ref Error[E]) -> Bool
if
  E: Equal

Returns true if self and the given object are equal to each other.

This operator is used to perform structural equality. This means two objects residing in different memory locations may be considered equal, provided their structure is equal. For example, two different arrays may be considered to have structural equality if they contain the exact same values.

fmt

Show source code
Hide source code
fn pub fmt(formatter: mut Formatter) {
  formatter
    .object('Error')
    .field('kind', @kind)
    .field('offset', @offset)
    .finish
}
fn pub fmt(formatter: mut Formatter)
if
  E: Format

Formats self in a human-readable format for debugging purposes.

to_string

Show source code
Hide source code
fn pub to_string -> String {
  match @kind {
    case Read(e) -> {
      'failed to read more bytes at byte offset ${@offset}: ${e}'
    }
    case MissingColumn -> 'a column is expected at byte offset ${@offset}'
    case EndOfInput -> {
      'the end of the input stream is reached, but more input is required'
    }
    case UnexpectedCharacter -> {
      'the character at byte offset ${@offset} is unexpected'
    }
  }
}
fn pub to_string -> String
if
  E: ToString

Converts self to a String.

Implemented traits

std.cmp.

Equal

impl Equal for Error
if
  E: Equal
std.fmt.

Format

impl Format for Error
if
  E: Format
std.string.

ToString

impl ToString for Error
if
  E: ToString