Functions

Struct Functions 

Source
pub struct Functions { /* private fields */ }

Implementations§

Source§

impl Functions

Source

pub fn new(client: &Client) -> Self

Source

pub fn list( &self, search: Option<&str>, limit: Option<i64>, offset: Option<i64>, cursor: Option<&str>, cursor_direction: Option<&str>, order_type: Option<&str>, ) -> Result<FunctionList, AppwriteException>

Get a list of all the project’s functions. You can use the query params to filter your results.

Source

pub fn create( &self, function_id: &str, name: &str, execute: &[&str], runtime: &str, vars: Option<Option<HashMap<String, ParamType>>>, events: Option<&[&str]>, schedule: Option<&str>, timeout: Option<i64>, ) -> Result<Function, AppwriteException>

Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.

Source

pub fn list_runtimes(&self) -> Result<RuntimeList, AppwriteException>

Get a list of all runtimes that are currently active on your instance.

Source

pub fn get(&self, function_id: &str) -> Result<Function, AppwriteException>

Get a function by its unique ID.

Source

pub fn update( &self, function_id: &str, name: &str, execute: &[&str], vars: Option<Option<HashMap<String, ParamType>>>, events: Option<&[&str]>, schedule: Option<&str>, timeout: Option<i64>, ) -> Result<Function, AppwriteException>

Update function by its unique ID.

Source

pub fn delete(&self, function_id: &str) -> Result<Value, AppwriteException>

Delete a function by its unique ID.

Source

pub fn list_deployments( &self, function_id: &str, search: Option<&str>, limit: Option<i64>, offset: Option<i64>, cursor: Option<&str>, cursor_direction: Option<&str>, order_type: Option<&str>, ) -> Result<DeploymentList, AppwriteException>

Get a list of all the project’s code deployments. You can use the query params to filter your results.

Source

pub fn create_deployment( &self, function_id: &str, entrypoint: &str, code: PathBuf, activate: bool, ) -> Result<Deployment, AppwriteException>

Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you’ll need to update the function’s deployment to use your new deployment UID.

This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Appwrite Cloud Functions tutorial.

Use the “command” param to set the entry point used to execute your code.

Source

pub fn get_deployment( &self, function_id: &str, deployment_id: &str, ) -> Result<DeploymentList, AppwriteException>

Get a code deployment by its unique ID.

Source

pub fn update_deployment( &self, function_id: &str, deployment_id: &str, ) -> Result<Function, AppwriteException>

Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.

Source

pub fn delete_deployment( &self, function_id: &str, deployment_id: &str, ) -> Result<Value, AppwriteException>

Delete a code deployment by its unique ID.

Source

pub fn retry_build( &self, function_id: &str, deployment_id: &str, build_id: &str, ) -> Result<Value, AppwriteException>

Source

pub fn list_executions( &self, function_id: &str, limit: Option<i64>, offset: Option<i64>, search: Option<&str>, cursor: Option<&str>, cursor_direction: Option<&str>, ) -> Result<ExecutionList, AppwriteException>

Get a list of all the current user function execution logs. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project’s executions. Learn more about different API modes.

Source

pub fn create_execution( &self, function_id: &str, data: Option<&str>, xasync: Option<bool>, ) -> Result<Execution, AppwriteException>

Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.

Source

pub fn get_execution( &self, function_id: &str, execution_id: &str, ) -> Result<Execution, AppwriteException>

Get a function execution log by its unique ID.

Source

pub fn get_usage( &self, function_id: &str, range: Option<&str>, ) -> Result<UsageFunctions, AppwriteException>

Trait Implementations§

Source§

impl Clone for Functions

Source§

fn clone(&self) -> Functions

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 T
where 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> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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

Source§

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

impl<T> ErasedDestructor for T
where T: 'static,