TypedValue
open class TypedValue : OptionalRustObject
A wrapper around Mentat’s TypedValue
Rust object. This class wraps a raw pointer to a Rust TypedValue
struct and provides accessors to the values according to expected result type.
As the FFI functions for fetching values are consuming, this class keeps a copy of the result internally after fetching so that the value can be referenced several times.
Also, due to the consuming nature of the FFI layer, this class also manages it’s raw pointer, nilling it after calling the FFI conversion function so that the underlying base class can manage cleanup.
-
This value as a
Int64
. This function will panic if theValueType
of thisTypedValue
is not aLong
Declaration
Swift
open func asLong() -> Int64
Return Value
the value of this
TypedValue
as aInt64
-
This value as a keyword
String
. This function will panic if theValueType
of thisTypedValue
is not aKeyword
Declaration
Swift
open func asKeyword() -> String
Return Value
the value of this
TypedValue
as a keywordString
-
This value as a
Bool
. This function will panic if theValueType
of thisTypedValue
is not aBoolean
Declaration
Swift
open func asBool() -> Bool
Return Value
the value of this
TypedValue
as aBool
-
This value as a
Double
. This function will panic if theValueType
of thisTypedValue
is not aDouble
Declaration
Swift
open func asDouble() -> Double
Return Value
the value of this
TypedValue
as aDouble
-
This value as a
Date
. This function will panic if theValueType
of thisTypedValue
is not aInstant
Declaration
Swift
open func asDate() -> Date
Return Value
the value of this
TypedValue
as aDate
-
This value as a
String
. This function will panic if theValueType
of thisTypedValue
is not aString
Declaration
Swift
open func asString() -> String
Return Value
the value of this
TypedValue
as aString
-
This value as a
UUID
. This function will panic if theValueType
of thisTypedValue
is not aUuid
Declaration
Swift
open func asUUID() -> UUID?
Return Value
the value of this
TypedValue
as aUUID?
. If theUUID
is not valid then this function returns nil. -
Undocumented
Declaration
Swift
override open func cleanup(pointer: OpaquePointer)