Skip to main content

StructView

Struct StructView 

Source
pub struct StructView<'graph, 'a> { /* private fields */ }
Expand description

A graph-aware view of a struct type.

Implementations§

Source§

impl<'graph, 'a> StructView<'graph, 'a>

Source

pub fn description(&self) -> Option<&'a str>

Returns the description, if present in the schema.

Source

pub fn fields(&self) -> impl Iterator<Item = StructFieldView<'_, 'graph, 'a>>

Returns an iterator over all fields, including fields inherited from allOf schemas. Fields are returned in declaration order: ancestor fields first, in the order of their parents in allOf; then this struct’s own fields.

Source

pub fn own_fields( &self, ) -> impl Iterator<Item = StructFieldView<'_, 'graph, 'a>>

Returns an iterator over fields declared directly on this struct, excluding inherited fields.

Source

pub fn parents(&self) -> impl Iterator<Item = TypeView<'graph, 'a>>

Returns an iterator over immediate parent types from allOf, including named and inline schemas.

Trait Implementations§

Source§

impl<'graph, 'a> Debug for StructView<'graph, 'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'graph, 'a> Freeze for StructView<'graph, 'a>

§

impl<'graph, 'a> !RefUnwindSafe for StructView<'graph, 'a>

§

impl<'graph, 'a> Send for StructView<'graph, 'a>

§

impl<'graph, 'a> Sync for StructView<'graph, 'a>

§

impl<'graph, 'a> Unpin for StructView<'graph, 'a>

§

impl<'graph, 'a> UnsafeUnpin for StructView<'graph, 'a>

§

impl<'graph, 'a> !UnwindSafe for StructView<'graph, 'a>

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<'graph, 'a, T> ExtendableView<'graph, 'a> for T
where 'a: 'graph, T: ViewNode<'graph, 'a>,

Source§

fn extensions(&self) -> &ViewExtensions<T>

Returns a reference to this type’s extended data.
Source§

fn extensions_mut(&mut self) -> &mut ViewExtensions<T>

Returns a mutable reference to this type’s extended data.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.
Source§

impl<'graph, 'a, T> View<'graph, 'a> for T
where 'a: 'graph, T: ViewNode<'graph, 'a>,

Source§

fn inlines( &self, ) -> impl Iterator<Item = InlineTypeView<'graph, 'a>> + use<'graph, 'a, T>

Returns an iterator over all the inline types that are contained within this type.
Source§

fn used_by( &self, ) -> impl Iterator<Item = OperationView<'graph, 'a>> + use<'graph, 'a, T>

Returns an iterator over the operations that use this type. Read more
Source§

fn dependencies( &self, ) -> impl Iterator<Item = TypeView<'graph, 'a>> + use<'graph, 'a, T>

Returns an iterator over all the types that this type transitively depends on. This is forward propagation: this type depends on each reachable type. Read more
Source§

fn dependents( &self, ) -> impl Iterator<Item = TypeView<'graph, 'a>> + use<'graph, 'a, T>

Returns an iterator over all the types that transitively depend on this type. This is backward propagation: each returned type depends on this type. Read more
Source§

fn hashable(&self) -> bool

Returns true if this type can implement Eq and Hash.
Source§

fn defaultable(&self) -> bool

Returns true if this type can implement Default.