pub enum AsyncConfig {
None,
All,
AllExceptImports(HashSet<String>),
OnlyImports(HashSet<String>),
}
Expand description
Which imports should be generated as async functions.
The imports should be declared in the following format:
- Regular functions:
"{function-name}"
- Resource methods:
"[method]{resource-name}.{method-name}"
- Resource destructors:
"[drop]{resource-name}"
Examples:
- Regular function:
"get-environment"
- Resource method:
"[method]input-stream.read"
- Resource destructor:
"[drop]input-stream"
Variants§
None
No functions are async
.
All
All generated functions should be async
.
AllExceptImports(HashSet<String>)
These imported functions should not be async, but everything else is.
OnlyImports(HashSet<String>)
These functions are the only imports that are async, all other imports are sync.
Note that all exports are still async in this situation.
Implementations§
Source§impl AsyncConfig
impl AsyncConfig
pub fn is_import_async(&self, f: &str) -> bool
pub fn is_drop_async(&self, r: &str) -> bool
pub fn maybe_async(&self) -> bool
Trait Implementations§
Source§impl Clone for AsyncConfig
impl Clone for AsyncConfig
Source§fn clone(&self) -> AsyncConfig
fn clone(&self) -> AsyncConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AsyncConfig
impl Debug for AsyncConfig
Source§impl Default for AsyncConfig
impl Default for AsyncConfig
Source§fn default() -> AsyncConfig
fn default() -> AsyncConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AsyncConfig
impl RefUnwindSafe for AsyncConfig
impl Send for AsyncConfig
impl Sync for AsyncConfig
impl Unpin for AsyncConfig
impl UnwindSafe for AsyncConfig
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