pub struct Client { /* private fields */ }Expand description
Client for invoking serverless functions.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new() -> Result<Self, ServerlessError>
pub fn new() -> Result<Self, ServerlessError>
Creates a new client with default configuration.
§Errors
Returns an error if the client cannot be created.
Sourcepub fn with_config(config: Config) -> Result<Self, ServerlessError>
pub fn with_config(config: Config) -> Result<Self, ServerlessError>
Creates a new client with custom configuration.
§Errors
Returns an error if the client cannot be created.
Sourcepub async fn call_function(
&self,
function_name: &str,
payload: Vec<u8>,
headers: Option<HashMap<String, String>>,
) -> Result<Vec<u8>, ServerlessError>
pub async fn call_function( &self, function_name: &str, payload: Vec<u8>, headers: Option<HashMap<String, String>>, ) -> Result<Vec<u8>, ServerlessError>
Sourcepub fn serializer(&self) -> &Serializer
pub fn serializer(&self) -> &Serializer
Returns a reference to the underlying serializer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe 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