pub struct ApiKey(_);
Expand description

is the container of the api key validated.

To check validity of the given api key, users need to create an api key variable via ApiKey::from.

Implementations

is needed to automatically check validation of api key for new instance.

The internet connection is required to achieve the task.

Error

The function will return error if given api key is invalid or there is a bad internet connection.

Examples
    use tcmb_evds::common::ApiKey;
    use tcmb_evds::error::ReturnError;


    // If user key entered is valid, the function creates api_key variable. 
    // Otherwise, returns one of ReturnError options.
    // The function returns an error unless users write their own valid api key.
    let result = ApiKey::from("users_key".to_string());


    // Users can handle error in a different way.
    let api_key = match result {
        Err(return_error) => { 
            println!("{}", return_error.to_string()); 
            return;
        },
        Ok(api_key) => api_key,
    };

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.