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§
sourcefn 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_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
sourcefn 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_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,
sourcefn 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>>
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>>
Delete an object https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE
Object Safety§
This trait is not object safe.