pub struct Client {
pub field_service: FieldServiceClient,
pub professional_services: ProfessionalServicesClient,
pub shift: ShiftClient,
}Expand description
The main PlanSolve API client. Exposes one sub-client per optimization type.
Fields§
§field_service: FieldServiceClient§professional_services: ProfessionalServicesClient§shift: ShiftClientImplementations§
Source§impl Client
impl Client
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Creates a new client for the production environment.
Sourcepub fn with_environment(
api_key: impl Into<String>,
environment: Environment,
) -> Self
pub fn with_environment( api_key: impl Into<String>, environment: Environment, ) -> Self
Creates a new client for a specific environment.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Creates a production client using the PLANSOLVE_API_KEY environment
variable for the API key. The base URL is always the fixed production URL.
Returns Error::MissingApiKey if the variable is unset or empty.
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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