pub struct TMFClient { /* private fields */ }
Implementations§
Source§impl TMFClient
impl TMFClient
Sourcepub fn new(host: impl Into<String>) -> TMFClient
pub fn new(host: impl Into<String>) -> TMFClient
Create a new TMFClient instance
let client = TMFClient::new("http://localhost:8000");
Examples found in repository?
examples/create_quote.rs (line 16)
11fn main() -> Result<(),TMFError> {
12 #[cfg(feature = "tmf632")]
13 {
14 let quote = Quote::new();
15
16 let new_quote = TMFClient::new("https://localhost:8001")
17 .tmf648()
18 .quote()
19 .create(quote)?;
20
21
22 dbg!(new_quote);
23
24 }
25
26 Ok(())
27}
More examples
examples/create_organization.rs (line 14)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf632")]
11 {
12 let org = Organization::new("An Organization");
13
14 let client = TMFClient::new("https://localhost:8001")
15 .tmf632()
16 .organization()
17 .create(org)?;
18
19 dbg!(client);
20 }
21
22 Ok(())
23}
examples/create_site.rs (line 15)
10fn main() -> Result<(),TMFError> {
11 #[cfg(feature = "tmf674")]
12 {
13 let site = GeographicSite::new("Example Bad Site");
14
15 let new_site = TMFClient::new("https://localhost:8001")
16 .tmf674()
17 .site()
18 .create(site)?;
19
20
21 dbg!(new_site);
22
23 }
24
25 Ok(())
26}
examples/get_customer.rs (line 12)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf629")]
11 {
12 let clients = TMFClient::new("https://localhost:8001")
13 .tmf629()
14 .customer()
15 .list(None)?;
16
17 for c in clients {
18 println!("Name: {} Id: {}",c.get_name(),c.get_id());
19 }
20
21 }
22
23 Ok(())
24}
examples/get_organization.rs (line 12)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf632")]
11 {
12 let organizations = TMFClient::new("https://localhost:8001")
13 .tmf632()
14 .organization()
15 .list(None)?;
16
17 for o in organizations {
18 println!("Name: {} , Id: {}",o.get_name(),o.get_id());
19 }
20
21 }
22
23 Ok(())
24}
examples/get_qualification.rs (line 12)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf645")]
11 {
12 let qualifications = TMFClient::new("https://localhost:8001")
13 .tmf645()
14 .check_qualifcation()
15 .list(None)?;
16
17 for q in qualifications {
18 println!("Name: {} Id: {}",q.get_description(),q.get_id());
19 }
20 }
21
22 Ok(())
23}
Additional examples can be found in:
Sourcepub fn tmf620(&mut self) -> TMF620
pub fn tmf620(&mut self) -> TMF620
Create access to TMF620 API
let tmf620 = TMFClient::new("http://localhost:8000")
.tmf620();
Examples found in repository?
examples/get_catalog.rs (line 15)
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 15)
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 15)
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 15)
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 16)
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 tmf622(&mut self) -> TMF622
pub fn tmf622(&mut self) -> TMF622
Create access to TMF622 API
let tmf620 = TMFClient::new("http://localhost:8000")
.tmf622();
Sourcepub fn tmf629(&mut self) -> TMF629
pub fn tmf629(&mut self) -> TMF629
Create access to TMF632 API
let tmf632 = TMFClient::new("http://localhost:8000")
.tmf629();
Examples found in repository?
examples/get_customer.rs (line 13)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf629")]
11 {
12 let clients = TMFClient::new("https://localhost:8001")
13 .tmf629()
14 .customer()
15 .list(None)?;
16
17 for c in clients {
18 println!("Name: {} Id: {}",c.get_name(),c.get_id());
19 }
20
21 }
22
23 Ok(())
24}
More examples
examples/create_customer.rs (line 19)
11fn main() -> Result<(),TMFError> {
12 #[cfg(feature = "tmf629")]
13 {
14 let org = Organization::new("An Organization Example");
15
16 let customer = Customer::new(org);
17
18 let new_customer = TMFClient::new("https://localhost:8001")
19 .tmf629()
20 .customer()
21 .create(customer)?;
22
23 dbg!(new_customer);
24 }
25 Ok(())
26}
Sourcepub fn tmf632(&mut self) -> TMF632
pub fn tmf632(&mut self) -> TMF632
Create access to TMF632 API
let tmf632 = TMFClient::new("http://localhost:8000")
.tmf632();
Examples found in repository?
examples/create_organization.rs (line 15)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf632")]
11 {
12 let org = Organization::new("An Organization");
13
14 let client = TMFClient::new("https://localhost:8001")
15 .tmf632()
16 .organization()
17 .create(org)?;
18
19 dbg!(client);
20 }
21
22 Ok(())
23}
More examples
examples/get_organization.rs (line 13)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf632")]
11 {
12 let organizations = TMFClient::new("https://localhost:8001")
13 .tmf632()
14 .organization()
15 .list(None)?;
16
17 for o in organizations {
18 println!("Name: {} , Id: {}",o.get_name(),o.get_id());
19 }
20
21 }
22
23 Ok(())
24}
examples/get_individual.rs (line 16)
10fn main() -> Result<(),TMFError> {
11 #[cfg(feature = "tmf632")]
12 {
13 let mut client = TMFClient::new("https://localhost:8001");
14
15 let individuals = client
16 .tmf632()
17 .individual()
18 .list(None)?;
19
20 for i in individuals {
21 println!("Name: {} Id: {}, Gender: {}",i.get_name(),i.get_id(),i.gender.unwrap_or("Gender not set".to_string()));
22 }
23
24 }
25
26 Ok(())
27}
examples/create_individual.rs (line 20)
10fn main() -> Result<(),TMFError> {
11 #[cfg(feature = "tmf632")]
12 {
13 let individual = Individual::new("John Example Citizen")
14 .email("John.q.cititzen@example.com")
15 .gender("Male")
16 .title("Master");
17
18 let mut client = TMFClient::new("https://localhost:8001");
19
20 let new_individual = client.tmf632().individual().create(individual)?;
21
22 dbg!(new_individual);
23
24 }
25
26 Ok(())
27}
pub fn tmf633(&mut self) -> TMF633
Sourcepub fn tmf645(&mut self) -> TMF645
pub fn tmf645(&mut self) -> TMF645
Examples found in repository?
examples/get_qualification.rs (line 13)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf645")]
11 {
12 let qualifications = TMFClient::new("https://localhost:8001")
13 .tmf645()
14 .check_qualifcation()
15 .list(None)?;
16
17 for q in qualifications {
18 println!("Name: {} Id: {}",q.get_description(),q.get_id());
19 }
20 }
21
22 Ok(())
23}
More examples
examples/create_qualification.rs (line 15)
9fn main() -> Result<(),TMFError> {
10 #[cfg(feature = "tmf645")]
11 {
12 let qualification = CheckServiceQualification::new("A Qualification Example");
13
14 let new_qual = TMFClient::new("https://localhost:8001")
15 .tmf645()
16 .check_qualifcation()
17 .create(qualification)?;
18
19 dbg!(new_qual);
20
21 }
22 Ok(())
23}
Sourcepub fn tmf648(&mut self) -> TMF648
pub fn tmf648(&mut self) -> TMF648
Examples found in repository?
examples/create_quote.rs (line 17)
11fn main() -> Result<(),TMFError> {
12 #[cfg(feature = "tmf632")]
13 {
14 let quote = Quote::new();
15
16 let new_quote = TMFClient::new("https://localhost:8001")
17 .tmf648()
18 .quote()
19 .create(quote)?;
20
21
22 dbg!(new_quote);
23
24 }
25
26 Ok(())
27}
More examples
examples/get_quote.rs (line 12)
6fn main() -> Result<(),TMFError> {
7 #[cfg(feature = "tmf648")]
8 {
9 let mut client = TMFClient::new("https://localhost:8001");
10
11 let quotes = client
12 .tmf648()
13 .quote()
14 .list(None)?;
15
16 for i in quotes {
17 use tmflib::{HasDescription, HasName};
18
19 println!("Name: {}, \tDesc: {}",&i.get_name(),i.get_description());
20 }
21
22 }
23
24 Ok(())
25}
Sourcepub fn tmf674(&mut self) -> TMF674
pub fn tmf674(&mut self) -> TMF674
Examples found in repository?
examples/create_site.rs (line 16)
10fn main() -> Result<(),TMFError> {
11 #[cfg(feature = "tmf674")]
12 {
13 let site = GeographicSite::new("Example Bad Site");
14
15 let new_site = TMFClient::new("https://localhost:8001")
16 .tmf674()
17 .site()
18 .create(site)?;
19
20
21 dbg!(new_site);
22
23 }
24
25 Ok(())
26}
Auto Trait Implementations§
impl Freeze for TMFClient
impl RefUnwindSafe for TMFClient
impl Send for TMFClient
impl Sync for TMFClient
impl Unpin for TMFClient
impl UnwindSafe for TMFClient
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