Trait goatns::web::api::APIEntity

source ·
trait APIEntity {
    // Required methods
    fn api_create<'async_trait>(
        __arg0: State<Arc<RwLock<GoatChildState>>>,
        session: Session,
        __arg2: Json<Value>
    ) -> Pin<Box<dyn Future<Output = Result<Json<Box<Self>>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn api_update<'async_trait>(
        __arg0: State<Arc<RwLock<GoatChildState>>>,
        session: Session,
        __arg2: Json<Value>
    ) -> Pin<Box<dyn Future<Output = Result<Json<String>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>;
    fn api_get<'async_trait>(
        __arg0: State<Arc<RwLock<GoatChildState>>>,
        session: Session,
        __arg2: Path<i64>
    ) -> Pin<Box<dyn Future<Output = Result<Json<Box<Self>>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn api_delete<'async_trait>(
        __arg0: State<Arc<RwLock<GoatChildState>>>,
        session: Session,
        __arg2: Path<i64>
    ) -> Pin<Box<dyn Future<Output = Result<StatusCode, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>;
}
Expand description

This gets applied to DBEntities

Required Methods§

source

fn api_create<'async_trait>( __arg0: State<Arc<RwLock<GoatChildState>>>, session: Session, __arg2: Json<Value> ) -> Pin<Box<dyn Future<Output = Result<Json<Box<Self>>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
where Self: 'async_trait,

Save the entity to the database

source

fn api_update<'async_trait>( __arg0: State<Arc<RwLock<GoatChildState>>>, session: Session, __arg2: Json<Value> ) -> Pin<Box<dyn Future<Output = Result<Json<String>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>

source

fn api_get<'async_trait>( __arg0: State<Arc<RwLock<GoatChildState>>>, session: Session, __arg2: Path<i64> ) -> Pin<Box<dyn Future<Output = Result<Json<Box<Self>>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
where Self: 'async_trait,

source

fn api_delete<'async_trait>( __arg0: State<Arc<RwLock<GoatChildState>>>, session: Session, __arg2: Path<i64> ) -> Pin<Box<dyn Future<Output = Result<StatusCode, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>

Object Safety§

This trait is not object safe.

Implementors§