AttachmentFile
An attachment file description.
public struct AttachmentFile: Codable, Hashable
Inheritance
Codable
, Hashable
Initializers
init(type:size:mimeType:)
Init an attachment file.
public init(type: AttachmentFileType, size: Int64, mimeType: String?)
Parameters
type
: a file type.size
: a file size.mimeType
: a mime type.
init(url:)
public init(url: URL) throws
init(from:)
public init(from decoder: Decoder) throws
Properties
type
An attachment file type (see AttachmentFileType
).
public let type: AttachmentFileType
size
A size of the file.
public let size: Int64
mimeType
A mime type.
public let mimeType: String?
sizeFormatter
A file size formatter.
public static let sizeFormatter
sizeString
A formatted file size.
public var sizeString: String
Methods
encode(to:)
public func encode(to encoder: Encoder) throws