pub struct QueryOptions {
pub fields: Option<String>,
pub limit: Option<u16>,
pub offset: Option<u16>,
pub name: Option<String>,
}
Expand description
Fields for filtering output
Fields§
§fields: Option<String>
Specific set of fields delimited by comma
limit: Option<u16>
§offset: Option<u16>
§name: Option<String>
Filter on name
Implementations§
Source§impl QueryOptions
impl QueryOptions
pub fn fields(self, fields: String) -> QueryOptions
Sourcepub fn limit(self, limit: u16) -> QueryOptions
pub fn limit(self, limit: u16) -> QueryOptions
Examples found in repository?
examples/get_catalog.rs (line 13)
8fn main() {
9 #[cfg(feature = "tmf620")]
10 {
11 let mut client = TMFClient::new("https://localhost:8001");
12 let filter = QueryOptions::default()
13 .limit(2)
14 .offset(0);
15 let tmf = client.tmf620()
16 .catalog()
17 .list(Some(filter));
18 match tmf {
19 Ok(r) => {
20 // It worked
21 for c in r {
22 println!("Entry: {}",c.get_name())
23 }
24 },
25 Err(e) => {
26 println!("Error: {:?}",e)
27 },
28 }
29 }
30}
More examples
examples/get_category.rs (line 14)
8fn main() {
9 #[cfg(feature = "tmf620")]
10 {
11 // Get a list of categories from TMF620
12 let mut client = TMFClient::new("https://localhost:8001");
13 let filter = QueryOptions::default()
14 .limit(2)
15 .offset(0);
16 let tmf = client.tmf620()
17 .category()
18 .list(Some(filter));
19 match tmf {
20 Ok(r) => {
21 // It worked
22 for c in r {
23 println!("Entry: {}",c.get_name())
24 }
25 },
26 Err(e) => {
27 println!("Error: {:?}",e)
28 },
29 }
30 }
31}
Sourcepub fn offset(self, offset: u16) -> QueryOptions
pub fn offset(self, offset: u16) -> QueryOptions
Examples found in repository?
examples/get_catalog.rs (line 14)
8fn main() {
9 #[cfg(feature = "tmf620")]
10 {
11 let mut client = TMFClient::new("https://localhost:8001");
12 let filter = QueryOptions::default()
13 .limit(2)
14 .offset(0);
15 let tmf = client.tmf620()
16 .catalog()
17 .list(Some(filter));
18 match tmf {
19 Ok(r) => {
20 // It worked
21 for c in r {
22 println!("Entry: {}",c.get_name())
23 }
24 },
25 Err(e) => {
26 println!("Error: {:?}",e)
27 },
28 }
29 }
30}
More examples
examples/get_product_offering.rs (line 14)
8fn main() {
9 #[cfg(feature = "tmf620")]
10 {
11 let mut client = TMFClient::new("https://localhost:8001");
12 let filter = QueryOptions::default()
13 //.limit(2)
14 .offset(0);
15 let tmf = client.tmf620()
16 .product_offering()
17 .list(Some(filter));
18 match tmf {
19 Ok(r) => {
20 // It worked
21 for c in r {
22 println!("Entry: {} [{}]",c.get_name(),c.get_id())
23 }
24 },
25 Err(e) => {
26 println!("Error: {:?}",e)
27 },
28 }
29
30 }
31}
examples/get_product_offering_price.rs (line 14)
8fn main() {
9 #[cfg(feature = "tmf620")]
10 {
11 let mut client = TMFClient::new("https://localhost:8001");
12 let filter = QueryOptions::default()
13 //.limit(2)
14 .offset(0);
15 let tmf = client.tmf620()
16 .product_offering_price()
17 .list(Some(filter));
18 match tmf {
19 Ok(r) => {
20 // It worked
21 for c in r {
22 println!("Entry: {} [{}]",c.get_name(),c.get_id())
23 }
24 },
25 Err(e) => {
26 println!("Error: {:?}",e)
27 },
28 }
29 }
30}
examples/get_product_specification.rs (line 14)
8fn main() {
9 #[cfg(feature = "tmf620")]
10 {
11 let mut client = TMFClient::new("https://localhost:8001");
12 let filter = QueryOptions::default()
13 //.limit(2)
14 .offset(0);
15 let tmf = client.tmf620()
16 .product_specification()
17 .list(Some(filter));
18 match tmf {
19 Ok(r) => {
20 // It worked
21 for c in r {
22 println!("Entry: {} [{}]",c.get_name(),c.get_id())
23 }
24 },
25 Err(e) => {
26 println!("Error: {:?}",e)
27 },
28 }
29
30 }
31}
examples/get_category.rs (line 15)
8fn main() {
9 #[cfg(feature = "tmf620")]
10 {
11 // Get a list of categories from TMF620
12 let mut client = TMFClient::new("https://localhost:8001");
13 let filter = QueryOptions::default()
14 .limit(2)
15 .offset(0);
16 let tmf = client.tmf620()
17 .category()
18 .list(Some(filter));
19 match tmf {
20 Ok(r) => {
21 // It worked
22 for c in r {
23 println!("Entry: {}",c.get_name())
24 }
25 },
26 Err(e) => {
27 println!("Error: {:?}",e)
28 },
29 }
30 }
31}
pub fn name(self, name: impl Into<String>) -> QueryOptions
Trait Implementations§
Source§impl Clone for QueryOptions
impl Clone for QueryOptions
Source§fn clone(&self) -> QueryOptions
fn clone(&self) -> QueryOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for QueryOptions
impl Debug for QueryOptions
Source§impl Default for QueryOptions
impl Default for QueryOptions
Source§fn default() -> QueryOptions
fn default() -> QueryOptions
Returns the “default value” for a type. Read more
Source§impl From<QueryOptions> for String
impl From<QueryOptions> for String
Source§fn from(val: QueryOptions) -> Self
fn from(val: QueryOptions) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for QueryOptions
impl RefUnwindSafe for QueryOptions
impl Send for QueryOptions
impl Sync for QueryOptions
impl Unpin for QueryOptions
impl UnwindSafe for QueryOptions
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