BSONBinary
public struct BSONBinary : BSONValue, Equatable, Codable, Hashable
A struct to represent the BSON Binary type.
-
The binary data.
Declaration
Swift
public let data: ByteBuffer -
The binary subtype for this data.
Declaration
Swift
public let subtype: Subtype -
Subtypes for BSON Binary values.
See moreDeclaration
Swift
public struct Subtype : Equatable, Codable, Hashable, RawRepresentable -
Initializes a
BSONBinaryinstance from aUUID.Throws
BSONError.InvalidArgumentErrorif aBSONBinarycannot be constructed from this UUID.
Declaration
Swift
public init(from uuid: UUID) throws -
Initializes a
BSONBinaryinstance from aDataobject and aUInt8subtype.Throws
BSONError.InvalidArgumentErrorif the provided data is incompatible with the specified subtype.
Declaration
Swift
public init(data: Data, subtype: Subtype) throws -
Initializes a
BSONBinaryinstance from a base64Stringand aSubtype.Throws
BSONError.InvalidArgumentErrorif the base64Stringis invalid or if the provided data is incompatible with the specified subtype.
Declaration
Swift
public init(base64: String, subtype: Subtype) throws -
Declaration
Swift
public init(from decoder: Decoder) throws -
Declaration
Swift
public func encode(to: Encoder) throws -
Converts this
BSONBinaryinstance to aUUID.Throws
BSONError.InvalidArgumentErrorif a non-UUID subtype is set on thisBSONBinary.
Declaration
Swift
public func toUUID() throws -> UUID
View on GitHub
Install in Dash
BSONBinary Structure Reference