Enum FunctionKind
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(Id<TypeDef>)
A resource method where the first parameter is implicitly
borrow<T>.
interface foo {
resource r {
the-func: func();
}
}AsyncMethod(Id<TypeDef>)
An async resource method where the first parameter is implicitly
borrow<T>.
interface foo {
resource r {
the-func: async func();
}
}MethodGetter(Id<TypeDef>)
A resource getter where the first parameter is implicitly borrow<T>.
interface foo {
resource r {
the-prop: get() -> u32;
}
}MethodSetter(Id<TypeDef>)
A resource setter where the first parameter is implicitly borrow<T>.
interface foo {
resource r {
the-prop: set(value: u32);
}
}Static(Id<TypeDef>)
A static resource method.
interface foo {
resource r {
the-func: static func();
}
}AsyncStatic(Id<TypeDef>)
An async static resource method.
interface foo {
resource r {
the-func: static async func();
}
}StaticGetter(Id<TypeDef>)
A static resource getter.
interface foo {
resource r {
the-prop: static get() -> u32;
}
}StaticSetter(Id<TypeDef>)
A static resource setter.
interface foo {
resource r {
the-prop: static set(value: u32);
}
}Constructor(Id<TypeDef>)
A resource constructor where the return value is implicitly own<T>.
interface foo {
resource r {
constructor();
}
}Implementations§
§impl FunctionKind
impl FunctionKind
pub fn accessor(&self) -> Option<AccessorKind>
pub fn accessor(&self) -> Option<AccessorKind>
Returns whether this function is a getter or a setter.
pub fn resource(&self) -> Option<Id<TypeDef>>
pub fn resource(&self) -> Option<Id<TypeDef>>
Returns the resource, if present, that this function kind refers to.
pub fn resource_mut(&mut self) -> Option<&mut Id<TypeDef>>
pub fn resource_mut(&mut self) -> Option<&mut Id<TypeDef>>
Returns the resource, if present, that this function kind refers to.
Trait Implementations§
§impl Clone for FunctionKind
impl Clone for FunctionKind
§fn clone(&self) -> FunctionKind
fn clone(&self) -> FunctionKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for FunctionKind
impl Debug for FunctionKind
impl Eq for FunctionKind
§impl PartialEq for FunctionKind
impl PartialEq for FunctionKind
§impl Serialize for FunctionKind
impl Serialize for FunctionKind
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more