Struct TMFClient

Source
pub struct TMFClient { /* private fields */ }

Implementations§

Source§

impl TMFClient

Source

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
Hide additional 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}
Source

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
Hide additional 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}
Source

pub fn tmf622(&mut self) -> TMF622

Create access to TMF622 API

let tmf620 = TMFClient::new("http://localhost:8000")
    .tmf622();
Source

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
Hide additional 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}
Source

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
Hide additional 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}
Source

pub fn tmf633(&mut self) -> TMF633

Source

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
Hide additional 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}
Source

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
Hide additional 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}
Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,