pub trait Operations {
type TMF: HasId;
// Required methods
fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError>;
fn list(
&self,
filter: Option<QueryOptions>,
) -> Result<Vec<Self::TMF>, TMFError>;
fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError>;
fn update(
&self,
id: impl Into<String>,
patch: Self::TMF,
) -> Result<Self::TMF, TMFError>;
fn delete(&self, id: impl Into<String>) -> Result<Self::TMF, TMFError>;
}
Expand description
Standard set of operations for all TMF objects
Required Associated Types§
Required Methods§
Sourcefn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError>
fn get(&self, id: impl Into<String>) -> Result<Vec<Self::TMF>, TMFError>
Get a specific TMF object by Id
let categories = TMFClient::new("http://localhost:8000")
.tmf620()
.category()
.get("ID123");
Sourcefn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError>
fn list(&self, filter: Option<QueryOptions>) -> Result<Vec<Self::TMF>, TMFError>
Get a list of tmf objects applying optional filter
let filter = QueryOptions::default()
.limit(15)
.offset(10);
let categories = TMFClient::new("http://localhost:8000")
.tmf620()
.category()
.list(Some(filter));
Sourcefn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError>
fn create(&self, item: Self::TMF) -> Result<Self::TMF, TMFError>
Create a new instance of a TMF object
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.