std.base64.DecodeError
class pub enum DecodeError
An error produced when decoding a base64 encoded sequence of bytes.
Constructors
InvalidSize
InvalidSize()
The input size isn't a multiple of 4 bytes.
InvalidCharacter
InvalidCharacter(Int)
The character at the given byte offset is invalid.
Instance methods
!=
Show source codeHide 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 codeHide source code
fn pub ==(other: ref DecodeError) -> Bool {
match (self, other) {
case (InvalidSize, InvalidSize) -> true
case (InvalidCharacter(a), InvalidCharacter(b)) -> a == b
case _ -> false
}
}
fn pub ==(other: ref DecodeError) -> 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 codeHide source code
fn pub fmt(formatter: mut Formatter) {
match self {
case InvalidSize -> formatter.tuple('InvalidSize').finish
case InvalidCharacter(n) -> {
formatter.tuple('InvalidCharacter').field(n).finish
}
}
}
fn pub fmt(formatter: mut Formatter)
Formats self
in a human-readable format for debugging purposes.
to_string
Show source codeHide source code
fn pub to_string -> String {
match self {
case InvalidSize -> 'the input size is not a multiple of 4 bytes'
case InvalidCharacter(n) -> 'the character at byte offset ${n} is invalid'
}
}
fn pub to_string -> String
Converts self
to a String
.
Implemented traits
Equal
impl Equal[ref DecodeError] for DecodeError
Format
impl Format for DecodeError
ToString
impl ToString for DecodeError