carbon-sharky-decoder 2.0.0

Sharky Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
use {carbon_core::graphql::primitives::U8, juniper::GraphQLObject};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "NFTList")]
pub struct NFTListGraphQL {
    pub account_metadata: crate::accounts::graphql::AccountMetadataGraphQL,
    pub version: U8,
    pub collection_name: String,
}

impl TryFrom<crate::accounts::postgres::NFTListRow> for NFTListGraphQL {
    type Error = carbon_core::error::Error;
    fn try_from(row: crate::accounts::postgres::NFTListRow) -> Result<Self, Self::Error> {
        Ok(Self {
            account_metadata: row.account_metadata.into(),
            version: carbon_core::graphql::primitives::U8((*row.version) as u8),
            collection_name: row.collection_name,
        })
    }
}