Struct mangadex_api_schema_rust::ApiObject
source · pub struct ApiObject<A> {
pub id: Uuid,
pub type_: RelationshipType,
pub attributes: A,
pub relationships: Vec<Relationship>,
}Fields§
§id: Uuid§type_: RelationshipType§attributes: A§relationships: Vec<Relationship>Implementations§
source§impl<A> ApiObject<A>
impl<A> ApiObject<A>
pub fn find_relationships(&self, type_: RelationshipType) -> Vec<&Relationship>
pub fn find_first_relationships( &self, type_: RelationshipType ) -> Option<&Relationship>
Trait Implementations§
source§impl<'de, A> Deserialize<'de> for ApiObject<A>where
A: Deserialize<'de>,
impl<'de, A> Deserialize<'de> for ApiObject<A>where A: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<A> FromResponse for ApiObject<A>
impl<A> FromResponse for ApiObject<A>
source§impl<A> NamedType for ApiObject<A>where
A: Type + 'static,
impl<A> NamedType for ApiObject<A>where A: Type + 'static,
source§fn named_data_type(
opts: DefOpts<'_>,
generics: &[DataType]
) -> Result<NamedDataType, ExportError>
fn named_data_type( opts: DefOpts<'_>, generics: &[DataType] ) -> Result<NamedDataType, ExportError>
this is equivalent to Type::inline but returns a NamedDataType instead.
This is a compile-time guaranteed alternative to extracting the
DataType::Named variant.source§fn definition_named_data_type(
opts: DefOpts<'_>
) -> Result<NamedDataType, ExportError>
fn definition_named_data_type( opts: DefOpts<'_> ) -> Result<NamedDataType, ExportError>
this is equivalent to Type::definition but returns a NamedDataType instead.
This is a compile-time guaranteed alternative to extracting the
DataType::Named variant.source§impl<T> PartialEq for ApiObject<T>
impl<T> PartialEq for ApiObject<T>
source§impl<A> Type for ApiObject<A>where
A: Type + 'static,
impl<A> Type for ApiObject<A>where A: Type + 'static,
source§fn inline(
opts: DefOpts<'_>,
generics: &[DataType]
) -> Result<DataType, ExportError>
fn inline( opts: DefOpts<'_>, generics: &[DataType] ) -> Result<DataType, ExportError>
Returns the inline definition of a type with generics substituted for those provided.
This function defines the base structure of every type, and is used in both
definition and reference Read moresource§fn category_impl(
opts: DefOpts<'_>,
generics: &[DataType]
) -> Result<TypeCategory, ExportError>
fn category_impl( opts: DefOpts<'_>, generics: &[DataType] ) -> Result<TypeCategory, ExportError>
Defines which category this type falls into, determining how references to it are created.
See
TypeCategory for more info. Read moresource§fn definition_generics() -> Vec<GenericType>
fn definition_generics() -> Vec<GenericType>
Returns the type parameter generics of a given type.
Will usually be empty except for custom types. Read more
source§fn definition(opts: DefOpts<'_>) -> Result<DataType, ExportError>
fn definition(opts: DefOpts<'_>) -> Result<DataType, ExportError>
Small wrapper around
inline that provides
definition_generics
as the value for the generics arg. Read moresource§fn reference(
opts: DefOpts<'_>,
generics: &[DataType]
) -> Result<DataType, ExportError>
fn reference( opts: DefOpts<'_>, generics: &[DataType] ) -> Result<DataType, ExportError>
Generates a datatype corresponding to a reference to this type,
as determined by its category. Getting a reference to a type implies that
it should belong in the type map (since it has to be referenced from somewhere),
so the output of
definition will be put into the type map. Read moreimpl<A> Flatten for ApiObject<A>where A: Type + 'static,
Auto Trait Implementations§
impl<A> RefUnwindSafe for ApiObject<A>where A: RefUnwindSafe,
impl<A> Send for ApiObject<A>where A: Send,
impl<A> Sync for ApiObject<A>where A: Sync,
impl<A> Unpin for ApiObject<A>where A: Unpin,
impl<A> UnwindSafe for ApiObject<A>where A: UnwindSafe,
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