pub enum FunctionKind {
}Variants§
Freestanding
A freestanding function.
interface foo {
the-func: func();
}AsyncFreestanding
An async freestanding function.
interface foo {
the-func: async func();
}Getter
A getter function, which takes no parameters and returns a value.
interface foo {
the-prop: get() -> u32;
}Setter
A setter function, which takes one parameter and returns either nothing
or result<_, error?>.
interface foo {
the-prop: set(value: u32);
}Method(TypeId)
A resource method where the first parameter is implicitly
borrow<T>.
interface foo {
resource r {
the-func: func();
}
}AsyncMethod(TypeId)
An async resource method where the first parameter is implicitly
borrow<T>.
interface foo {
resource r {
the-func: async func();
}
}MethodGetter(TypeId)
A resource getter where the first parameter is implicitly borrow<T>.
interface foo {
resource r {
the-prop: get() -> u32;
}
}MethodSetter(TypeId)
A resource setter where the first parameter is implicitly borrow<T>.
interface foo {
resource r {
the-prop: set(value: u32);
}
}Static(TypeId)
A static resource method.
interface foo {
resource r {
the-func: static func();
}
}AsyncStatic(TypeId)
An async static resource method.
interface foo {
resource r {
the-func: static async func();
}
}StaticGetter(TypeId)
A static resource getter.
interface foo {
resource r {
the-prop: static get() -> u32;
}
}StaticSetter(TypeId)
A static resource setter.
interface foo {
resource r {
the-prop: static set(value: u32);
}
}Constructor(TypeId)
A resource constructor where the return value is implicitly own<T>.
interface foo {
resource r {
constructor();
}
}Implementations§
Source§impl FunctionKind
impl FunctionKind
Sourcepub fn accessor(&self) -> Option<AccessorKind>
pub fn accessor(&self) -> Option<AccessorKind>
Returns whether this function is a getter or a setter.
Sourcepub fn resource(&self) -> Option<TypeId>
pub fn resource(&self) -> Option<TypeId>
Returns the resource, if present, that this function kind refers to.
Sourcepub fn resource_mut(&mut self) -> Option<&mut TypeId>
pub fn resource_mut(&mut self) -> Option<&mut TypeId>
Returns the resource, if present, that this function kind refers to.
Trait Implementations§
Source§impl Clone for FunctionKind
impl Clone for FunctionKind
Source§impl Debug for FunctionKind
impl Debug for FunctionKind
impl Eq for FunctionKind
Source§impl PartialEq for FunctionKind
impl PartialEq for FunctionKind
Source§impl Serialize for FunctionKind
impl Serialize for FunctionKind
impl StructuralPartialEq for FunctionKind
Auto Trait Implementations§
impl Freeze for FunctionKind
impl RefUnwindSafe for FunctionKind
impl Send for FunctionKind
impl Sync for FunctionKind
impl Unpin for FunctionKind
impl UnsafeUnpin for FunctionKind
impl UnwindSafe for FunctionKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.