pub struct CodegenGraph<'a> { /* private fields */ }Expand description
A CookedGraph decorated with Rust-specific information.
Implementations§
Source§impl<'a> CodegenGraph<'a>
impl<'a> CodegenGraph<'a>
Sourcepub fn new(cooked: CookedGraph<'a>) -> Self
pub fn new(cooked: CookedGraph<'a>) -> Self
Wraps a type graph with the default configuration.
Sourcepub fn with_config(cooked: CookedGraph<'a>, config: &CodegenConfig) -> Self
pub fn with_config(cooked: CookedGraph<'a>, config: &CodegenConfig) -> Self
Wraps a type graph with the given configuration.
Sourcepub fn ident(&self, key: impl Into<IdentMapping<'a>>) -> UniqueIdent<'a>
pub fn ident(&self, key: impl Into<IdentMapping<'a>>) -> UniqueIdent<'a>
Returns the unique Rust identifier for a schema, operation, parameter, field, or variant.
Sourcepub fn resource_for(&self, view: &impl HasResource<'a>) -> ResourceGroup<'a>
pub fn resource_for(&self, view: &impl HasResource<'a>) -> ResourceGroup<'a>
Returns the resource that contains the given view.
Sourcepub fn date_time_format(&self) -> DateTimeFormat
pub fn date_time_format(&self) -> DateTimeFormat
Returns the format to use for date-time types.
Methods from Deref<Target = CookedGraph<'a>>§
Sourcepub fn schemas(
&self,
) -> impl Iterator<Item = SchemaTypeView<'_, 'a>> + use<'_, 'a>
pub fn schemas( &self, ) -> impl Iterator<Item = SchemaTypeView<'_, 'a>> + use<'_, 'a>
Returns an iterator over all the named schemas in this graph.
Sourcepub fn schema(&self, name: &str) -> Option<SchemaTypeView<'_, 'a>>
pub fn schema(&self, name: &str) -> Option<SchemaTypeView<'_, 'a>>
Looks up and returns a schema by name.
Sourcepub fn view(&self, id: TypeId) -> TypeView<'_, 'a>
pub fn view(&self, id: TypeId) -> TypeView<'_, 'a>
Looks up and returns a type view by its identifier.
Sourcepub fn primitives(
&self,
) -> impl Iterator<Item = PrimitiveView<'_, 'a>> + use<'_, 'a>
pub fn primitives( &self, ) -> impl Iterator<Item = PrimitiveView<'_, 'a>> + use<'_, 'a>
Returns an iterator over all primitive type nodes in this graph.
Sourcepub fn operations(
&self,
) -> impl Iterator<Item = OperationView<'_, 'a>> + use<'_, 'a>
pub fn operations( &self, ) -> impl Iterator<Item = OperationView<'_, 'a>> + use<'_, 'a>
Returns an iterator over all the operations in this graph.
Trait Implementations§
Source§impl<'a> Debug for CodegenGraph<'a>
impl<'a> Debug for CodegenGraph<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CodegenGraph<'a>
impl<'a> !Send for CodegenGraph<'a>
impl<'a> !Sync for CodegenGraph<'a>
impl<'a> !UnwindSafe for CodegenGraph<'a>
impl<'a> Freeze for CodegenGraph<'a>
impl<'a> Unpin for CodegenGraph<'a>
impl<'a> UnsafeUnpin for CodegenGraph<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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 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>
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