Search results

There are no results.

std.crypto.pem.ParseError

type pub inline enum ParseError[E]

An error produced while parsing a PEM file.

Constructors

EndOfInput

EndOfInput()

The input stream ran out of input, but more input is required.

InvalidBase64

InvalidBase64(Int)

The base64 encoded data inside a PEM section is invalid.

InvalidSectionEnd

InvalidSectionEnd(Int)

The end of a PEM section is invalid, e.g. its name doesn't match the name of the opening section.

InvalidSectionStart

InvalidSectionStart(Int)

The start of a PEM section is invalid, e.g. it's missing the closing -----.

Read

Read(E)

An IO error occurred while reading data to parse.

Instance methods

!=

Show source code
Hide source code
fn pub !=(other: ref Self) -> Bool {
  !(self == other)
}
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 ParseError[E]) -> Bool {
  match (self, other) {
    case (Read(a), Read(b)) -> a == b
    case (EndOfInput, EndOfInput) -> true
    case (InvalidSectionStart(a), InvalidSectionStart(b)) -> a == b
    case (InvalidSectionEnd(a), InvalidSectionEnd(b)) -> a == b
    case (InvalidBase64(a), InvalidBase64(b)) -> a == b
    case _ -> false
  }
}
fn pub ==(other: ref ParseError[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) {
  match self {
    case Read(e) -> formatter.tuple('Read').field(e).finish
    case EndOfInput -> formatter.tuple('EndOfInput').finish
    case InvalidSectionStart(v) -> {
      formatter.tuple('InvalidSectionStart').field(v).finish
    }
    case InvalidSectionEnd(v) -> {
      formatter.tuple('InvalidSectionEnd').field(v).finish
    }
    case InvalidBase64(a) -> formatter.tuple('InvalidBase64').field(a).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 self {
    case Read(e) -> e.to_string
    case EndOfInput -> {
      'the end of the input stream is reached, but more input is required'
    }
    case InvalidSectionStart(line) -> {
      'the section start on line ${line} is invalid'
    }
    case InvalidSectionEnd(line) -> {
      'the section end on line ${line} is invalid'
    }
    case InvalidBase64(line) -> {
      'the base64 encoded data on line ${line} is invalid'
    }
  }
}
fn pub to_string -> String
if
  E: ToString

Converts self to a String.

Implemented traits

std.cmp.

Equal

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

Format

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

ToString

impl ToString for ParseError
if
  E: ToString