Enum mpesa::environment::Environment [−][src]
Enum to map to desired environment so as to access certificate
and the base url
Required to construct a new Mpesa
struct
Variants
Implementations
impl Environment
[src]
pub fn base_url(&self) -> &'static str
[src]
Matches to intended base_url depending on Environment variant
Example
use mpesa::Environment; let env: Environment = Environment::Production; let base_url: &str = env.base_url(); assert_eq!("https://api.safaricom.co.ke", base_url);
pub fn get_certificate(&self) -> &'static str
[src]
Match to X509 public key certificate based on environment variant
Trait Implementations
impl Debug for Environment
[src]
impl FromStr for Environment
[src]
type Err = MpesaError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl TryFrom<&'static str> for Environment
[src]
Auto Trait Implementations
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnwindSafe for Environment
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,