pub struct TypeSchema {
pub name: &'static str,
pub cases: &'static [&'static str],
pub fields: &'static [FieldSchema],
}Expand description
The shape of one type a host declares.
A host type is ordinary data: http.Method is an enum whose cases carry
nothing, and http.Route is a struct initialized with labels, exactly as a
Cove struct is. Neither needs a representation of its own — the runtime
builds an enum or a struct value whose type name is qualified by the module
— so what the schema adds is only the vocabulary: which names exist and
what they are made of.
A type whose values the host keeps rather than hands over is a
ResourceSchema instead.
Fields§
§name: &'static strThe name Cove source writes after the module, such as Route.
cases: &'static [&'static str]The cases, for an enum. Empty for a struct.
fields: &'static [FieldSchema]The fields, for a struct. Empty for an enum.
Implementations§
Source§impl TypeSchema
impl TypeSchema
Trait Implementations§
Source§impl Clone for TypeSchema
impl Clone for TypeSchema
Source§fn clone(&self) -> TypeSchema
fn clone(&self) -> TypeSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TypeSchema
Source§impl Debug for TypeSchema
impl Debug for TypeSchema
impl Eq for TypeSchema
Source§impl PartialEq for TypeSchema
impl PartialEq for TypeSchema
Source§fn eq(&self, other: &TypeSchema) -> bool
fn eq(&self, other: &TypeSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TypeSchema
Auto Trait Implementations§
impl Freeze for TypeSchema
impl RefUnwindSafe for TypeSchema
impl Send for TypeSchema
impl Sync for TypeSchema
impl Unpin for TypeSchema
impl UnsafeUnpin for TypeSchema
impl UnwindSafe for TypeSchema
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.