[][src]Struct ksoft::kumo::Kumo

pub struct Kumo {
    pub http: Arc<HttpClient>,
}

Fields

http: Arc<HttpClient>

Implementations

impl Kumo[src]

pub fn new(http_client: Arc<HttpClient>) -> Self[src]

pub async fn geoip<'_>(
    &'_ self,
    ip: impl ToString
) -> HttpResult<GeoIPResponse, KumoError>
[src]

Get data from a given IP address

Example

This example is not tested
if let Ok(res) = client.kumo.geoip("AmazingNonExistingIP").await {
    match res {
        Ok(ip) => {
            //do something with ip info
        },
        Err(why) => {
            //do something with the <KumoError> struct
        }
    }
}

pub async fn convert_currency<C: ToString, '_>(
    &'_ self,
    value: f64,
    from: C,
    to: C
) -> HttpResult<CurrencyConversionResponse, KumoError>
[src]

Performs currency conversion

Example

This example is not tested
if let Ok(res) = client.kumo.convert_currency(120.0, "USD", "EUR").await {
    match res {
        Ok(conversion) => {
            //do something with conversion info
        },
        Err(why) => {
            //do something with the <KumoError> struct
        }
    }
}

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.