Enum seamless::ApiBodyType [−][src]
An enum representing the shape of the JSON that is provided or output from the API. There is a straightforward mapping from this to TypeScript types.
Variants
Corresponds to the TypeScript type string
.
Corresponds to the TypeScript type number
.
Corresponds to the TypeScript type boolean
.
Corresponds to the TypeScript type null
.
Corresponds to the TypeScript type any
.
This is used when the shape cannot be statically determined for one reason or another.
An array of values of one type, where each value has the type value
, eg
string[]
or number[]
.
Fields of ArrayOf
value: Box<ApiBodyInfo>
The type of all of the values in the array.
A fixed length array of values that can be of mixed types, eg
[string, number, Foo]
.
Fields of TupleOf
values: Vec<ApiBodyInfo>
A list of each of the types in this fixed length array.
An object where the keys are strings and the values are all of the same type, eg
{ [key: string]: Foo }
.
Fields of ObjectOf
value: Box<ApiBodyInfo>
The type of all of the values in the object/map.
An object whose keys and value types are known at compile time, eg
{ foo: string, bar: boolean, wibble: Foo }
.
Fields of Object
keys: HashMap<String, ApiBodyInfo>
The property name and type of each entry in the object.
The type is one of several variants, eg
string | number | Foo
.
Fields of OneOf
values: Vec<ApiBodyInfo>
Each of the possible types that this can be.
The type is a string literal with a specific value, eg
"stringvalue"
.
Fields of StringLiteral
literal: String
The exact string literal that we expect.
The type is optional, and need not be provided. It corresponds to either
{ key?: Foo }
in objects, or Foo | undefined
in other contexts.
Fields of Optional
value: Box<ApiBodyInfo>
The type that is optional.
Trait Implementations
impl Clone for ApiBodyType
[src]
fn clone(&self) -> ApiBodyType
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ApiBodyType
[src]
impl Eq for ApiBodyType
[src]
impl PartialEq<ApiBodyType> for ApiBodyType
[src]
fn eq(&self, other: &ApiBodyType) -> bool
[src]
fn ne(&self, other: &ApiBodyType) -> bool
[src]
impl Serialize for ApiBodyType
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for ApiBodyType
[src]
impl StructuralPartialEq for ApiBodyType
[src]
Auto Trait Implementations
impl RefUnwindSafe for ApiBodyType
[src]
impl Send for ApiBodyType
[src]
impl Sync for ApiBodyType
[src]
impl Unpin for ApiBodyType
[src]
impl UnwindSafe for ApiBodyType
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,