Error
HBParser.swift:22enum Errorenum Errorimport HummingbirdCorestruct ParserReader object for parsing String buffers
case overflowcase unexpectedcase emptyStringcase invalidUTF8init(_ string: String) init?(_ utf8Data: some Collection<UInt8>, validateUTF8: Bool = true) Create a Parser object
var count: Int { get }Return contents of parser as a string
var string: String { get }Return contents of parser as a string
mutating func advance() throws Move forward one character
mutating func advance(by amount: Int) throws Move forward so many character
mutating func character() throws -> Unicode.Scalar Return current character
func current() -> Unicode.Scalar Return the character at the current position
func makeIterator() -> Parser.Iterator mutating func moveToEnd() Move parser to end of string
mutating func moveToStart() Move parser to beginning of string
func percentDecode() -> String? percent decode UTF8
func reachedEnd() -> Bool Return whether we have reached the end of the buffer
mutating func read(_ string: String) throws -> Bool Compare characters at current position against provided string. If the characters are the same as string provided advance past string
mutating func read(_ characterSet: Set<Unicode.Scalar>) throws -> Bool Read the current character and check if it is in a set of characters If character test returns true then move forward 1
mutating func read(_ char: Unicode.Scalar) throws -> Bool Read the current character and return if it is as intended. If character test returns true then move forward 1
mutating func read(count: Int) throws -> Parser Read next so many characters from buffer
@discardableResult mutating func read(until: (Unicode.Scalar) -> Bool, throwOnOverflow: Bool = true) throws -> Parser Read from buffer until we hit a character that returns true for supplied closure. Position after this is of the character we were checking for
@discardableResult mutating func read(until characterSet: Set<Unicode.Scalar>, throwOnOverflow: Bool = true) throws -> Parser Read from buffer until we hit a character in supplied set. Position after this is of the character we were checking for
@discardableResult mutating func read(until keyPath: KeyPath<Unicode.Scalar, Bool>, throwOnOverflow: Bool = true) throws -> Parser Read from buffer until we hit a character where supplied KeyPath is true. Position after this is of the character we were checking for
@discardableResult mutating func read(until: Unicode.Scalar, throwOnOverflow: Bool = true) throws -> Parser Read from buffer until we hit a character. Position after this is of the character we were checking for
@discardableResult mutating func read(untilString: String, throwOnOverflow: Bool = true, skipToEnd: Bool = false) throws -> Parser Read from buffer until we hit a string. By default the position after this is of the beginning of the string we were checking for
@discardableResult mutating func read(while: (Unicode.Scalar) -> Bool) -> Parser Read while character returns true for supplied closure
@discardableResult mutating func read(while characterSet: Set<Unicode.Scalar>) -> Parser Read while character at current position is in supplied set
@discardableResult mutating func read(while keyPath: KeyPath<Unicode.Scalar, Bool>) -> Parser Read while character returns true for supplied KeyPath
@discardableResult mutating func read(while: Unicode.Scalar) -> Int Read while character at current position is the one supplied
@discardableResult mutating func readUntilTheEnd() -> Parser Read from buffer from current position until the end of the buffer
mutating func retreat() throws Move backwards one character
mutating func retreat(by amount: Int) throws Move back so many characters
mutating func split(separator: Unicode.Scalar) -> [Parser] Split parser into sections separated by character
mutating func unsafeAdvance() mutating func unsafeAdvance(by amount: Int) struct Iteratortypealias Element = Unicode.Scalarprotocol EquatableA type that can be compared for value equality.
protocol Error : SendableA type representing an error value that can be thrown.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol SendableA thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.
static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.