Struct kittycad::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Entrypoint for interacting with the API client.

Implementations§

source§

impl Client

source

pub fn new_from_reqwest<T>( token: T, builder_http: ClientBuilder, builder_websocket: ClientBuilder ) -> Selfwhere T: ToString + Debug,

Create a new Client struct. It takes a type that can convert into an &str (String or Vec<u8> for example). As long as the function is given a valid API key your requests will work. Also takes reqwest client builders, for customizing the client’s behaviour.

source

pub fn new<T>(token: T) -> Selfwhere T: ToString + Debug,

Create a new Client struct. It takes a type that can convert into an &str (String or Vec<u8> for example). As long as the function is given a valid API key your requests will work.

source

pub fn set_base_url<H>(&mut self, base_url: H)where H: Into<String> + Display + Debug,

Set the base URL for the client to something other than the default: https://api.kittycad.io.

source

pub fn new_from_env() -> Self

Create a new Client struct from the environment variable: KITTYCAD_API_TOKEN.

source

pub async fn request_raw( &self, method: Method, uri: &str, body: Option<Body> ) -> Result<RequestBuilder>

Create a raw request to our API.

source

pub fn ai(&self) -> Ai

AI uses machine learning to generate 3D meshes.

FROM: https://docs.kittycad.io/api/ai

source

pub fn api_calls(&self) -> ApiCalls

API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing.

FROM: https://docs.kittycad.io/api/api-calls

source

pub fn api_tokens(&self) -> ApiTokens

API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI.

FROM: https://docs.kittycad.io/api/api-tokens

source

pub fn apps(&self) -> Apps

Endpoints for third party app grant flows.

FROM: https://docs.kittycad.io/api/apps

source

pub fn executor(&self) -> Executor

Endpoints that allow for code execution or creation of code execution environments.

FROM: https://docs.kittycad.io/api/executor

source

pub fn file(&self) -> File

CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models.

FROM: https://docs.kittycad.io/api/file

source

pub fn hidden(&self) -> Hidden

Hidden API endpoints that should not show up in the docs.

FROM: https://docs.kittycad.io/api/hidden

source

pub fn meta(&self) -> Meta

Meta information about the API.

FROM: https://docs.kittycad.io/api/meta

source

pub fn modeling(&self) -> Modeling

Modeling API for updating your 3D files using the KittyCAD engine.

FROM: https://docs.kittycad.io/api/modeling

source

pub fn oauth2(&self) -> Oauth2

Endpoints that implement OAuth 2.0 grant flows.

FROM: https://docs.kittycad.io/api/oauth2

source

pub fn payments(&self) -> Payments

Operations around payments and billing.

FROM: https://docs.kittycad.io/api/payments

source

pub fn unit(&self) -> Unit

Unit conversion operations.

FROM: https://docs.kittycad.io/api/file

source

pub fn users(&self) -> Users

A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves.

FROM: https://docs.kittycad.io/api/users

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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 Twhere 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> IntoResult<T> for T

§

type Err = Infallible

source§

fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

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