BSONBinary
public struct BSONBinary : Equatable, 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, Hashable, RawRepresentable, Codable -
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 aSubtypesubtype. This will always create a copy of the data.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 -
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