Search results

There are no results.

std.csv.Error

class pub Error

An error produced when parsing a CSV stream.

Fields

kind

let pub @kind: ErrorKind

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: T) -> Bool {
  (self == other).false?
}
fn pub !=(other: T) -> Bool

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) -> Bool {
  @kind == other.kind and @offset == other.offset
}
fn pub ==(other: ref Error) -> Bool

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)

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 UnexpectedCharacter -> {
      'the character at byte offset ${@offset} is unexpected'
    }
  }
}
fn pub to_string -> String

Converts self to a String.

Implemented traits

std.cmp.

Equal

impl Equal[ref Error] for Error
std.fmt.

Format

impl Format for Error
std.string.

ToString

impl ToString for Error