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 theValueTypeof thisTypedValueis not aLongDeclaration
Swift
open func asLong() -> Int64Return Value
the value of this
TypedValueas aInt64 -
This value as a keyword
String. This function will panic if theValueTypeof thisTypedValueis not aKeywordDeclaration
Swift
open func asKeyword() -> StringReturn Value
the value of this
TypedValueas a keywordString -
This value as a
Bool. This function will panic if theValueTypeof thisTypedValueis not aBooleanDeclaration
Swift
open func asBool() -> BoolReturn Value
the value of this
TypedValueas aBool -
This value as a
Double. This function will panic if theValueTypeof thisTypedValueis not aDoubleDeclaration
Swift
open func asDouble() -> DoubleReturn Value
the value of this
TypedValueas aDouble -
This value as a
Date. This function will panic if theValueTypeof thisTypedValueis not aInstantDeclaration
Swift
open func asDate() -> DateReturn Value
the value of this
TypedValueas aDate -
This value as a
String. This function will panic if theValueTypeof thisTypedValueis not aStringDeclaration
Swift
open func asString() -> StringReturn Value
the value of this
TypedValueas aString -
This value as a
UUID. This function will panic if theValueTypeof thisTypedValueis not aUuidDeclaration
Swift
open func asUUID() -> UUID?Return Value
the value of this
TypedValueas aUUID?. If theUUIDis not valid then this function returns nil. -
Undocumented
Declaration
Swift
override open func cleanup(pointer: OpaquePointer)
TypedValue Class Reference