PreludeSchema

Struct PreludeSchema 

Source
pub struct PreludeSchema { /* private fields */ }
Expand description

A simple schema implementation for prelude types.

Implementations§

Source§

impl PreludeSchema

Source

pub const fn new(id: ShapeId, shape_type: ShapeType) -> Self

Creates a new prelude schema.

Trait Implementations§

Source§

impl Debug for PreludeSchema

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Schema for PreludeSchema

Source§

fn shape_id(&self) -> &ShapeId

Returns the Shape ID of this schema.
Source§

fn shape_type(&self) -> ShapeType

Returns the shape type.
Source§

fn traits(&self) -> &TraitMap

Returns the traits associated with this schema.
Source§

fn member_name(&self) -> Option<&str>

Returns the member name if this is a member schema.
Source§

fn member_schema(&self, _name: &str) -> Option<&dyn Schema>

Returns the member schema by name (for structures and unions).
Source§

fn member_schema_by_index(&self, _index: usize) -> Option<&dyn Schema>

Returns the member schema by position index (for structures and unions). Read more
Source§

fn member(&self) -> Option<&dyn Schema>

Returns the member schema for collections (list member or map value).
Source§

fn key(&self) -> Option<&dyn Schema>

Returns the key schema for maps.
Source§

fn members(&self) -> Box<dyn Iterator<Item = &dyn Schema> + '_>

Returns an iterator over member schemas (for structures and unions).
Source§

fn member_index(&self) -> Option<usize>

Returns the member index for member schemas. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> SchemaExt for T
where T: Schema + ?Sized,

Source§

fn is_member(&self) -> bool

Returns true if this is a member schema.
Source§

fn is_structure(&self) -> bool

Returns true if this is a structure schema.
Source§

fn is_union(&self) -> bool

Returns true if this is a union schema.
Source§

fn is_list(&self) -> bool

Returns true if this is a list schema.
Source§

fn is_map(&self) -> bool

Returns true if this is a map schema.
Source§

fn is_blob(&self) -> bool

Returns true if this is a blob schema.
Source§

fn is_string(&self) -> bool

Returns true if this is a string schema.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more