pub enum PublicKind {
Show 25 variants
Any,
None,
Null,
Bool,
Bytes,
Datetime,
Decimal,
Duration,
Float,
Int,
Number,
Object,
String,
Uuid,
Regex,
Table(Vec<Table>),
Record(Vec<Table>),
Geometry(Vec<GeometryKind>),
Either(Vec<Kind>),
Set(Box<Kind>, Option<u64>),
Array(Box<Kind>, Option<u64>),
Function(Option<Vec<Kind>>, Option<Box<Kind>>),
Range,
Literal(KindLiteral),
File(Vec<String>),
}Expand description
The kind of a SurrealDB value.
Variants§
Any
The most generic type, can be anything.
None
None type.
Null
Null type.
Bool
Boolean type.
Bytes
Bytes type.
Datetime
Datetime type.
Decimal
Decimal type.
Duration
Duration type.
Float
64-bit floating point type.
Int
64-bit signed integer type.
Number
Number type, can be either a float, int or decimal. This is the most generic type for numbers.
Object
Object type.
String
String type.
Uuid
UUID type.
Regex
Regular expression type.
Table(Vec<Table>)
A table type.
Record(Vec<Table>)
A record type.
Geometry(Vec<GeometryKind>)
A geometry type.
Either(Vec<Kind>)
An either type. Can be any of the kinds in the vec.
Set(Box<Kind>, Option<u64>)
A set type.
Array(Box<Kind>, Option<u64>)
An array type.
Function(Option<Vec<Kind>>, Option<Box<Kind>>)
A function type. The first option is the argument types, the second is the optional return type.
Range
A range type.
Literal(KindLiteral)
A literal type.
The literal type is used to represent a type that can only be a single
value. For example, "a" is a literal type which can only ever be
"a". This can be used in the Kind::Either type to represent an
enum.
File(Vec<String>)
A file type.
If the kind was specified without a bucket the vec will be empty.
So <file> is just Kind::File(Vec::new())
Implementations§
Source§impl Kind
impl Kind
Sourcepub fn either(kinds: Vec<Kind>) -> Kind
pub fn either(kinds: Vec<Kind>) -> Kind
Create an either kind from a vector of kinds.
If after dedeplication the vector is empty, return Kind::None.
If after dedeplication the vector has one element, return that element.
If after dedeplication the vector has multiple elements, return an Either kind with the
elements.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Kind
impl<'de> Deserialize<'de> for Kind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Kind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Kind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<Kind> for PublicKind
impl From<Kind> for PublicKind
Source§impl From<Kind> for Kind
impl From<Kind> for Kind
Source§fn from(v: PublicKind) -> Self
fn from(v: PublicKind) -> Self
Source§impl FromFlatbuffers for Kind
impl FromFlatbuffers for Kind
Source§impl Serialize for Kind
impl Serialize for Kind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl ToFlatbuffers for Kind
impl ToFlatbuffers for Kind
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnsafeUnpin for Kind
impl UnwindSafe for Kind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more