pub struct LinkerInstance { /* private fields */ }Expand description
Describes a concrete interface which components may import.
Implementations§
Source§impl LinkerInstance
impl LinkerInstance
Sourcepub fn define_func(
&mut self,
name: impl Into<Arc<str>>,
func: Func,
) -> Result<()>
pub fn define_func( &mut self, name: impl Into<Arc<str>>, func: Func, ) -> Result<()>
Defines a new function for this interface with the provided name. Fails if the function already exists.
Sourcepub fn func(&self, name: impl AsRef<str>) -> Option<Func>
pub fn func(&self, name: impl AsRef<str>) -> Option<Func>
Gets the function in this interface with the given name, if any.
Sourcepub fn define_resource(
&mut self,
name: impl Into<Arc<str>>,
resource_ty: ResourceType,
) -> Result<()>
pub fn define_resource( &mut self, name: impl Into<Arc<str>>, resource_ty: ResourceType, ) -> Result<()>
Defines a new resource type for this interface with the provided name. Fails if the resource type already exists, or if the resource is abstract.
Sourcepub fn resource(&self, name: impl AsRef<str>) -> Option<ResourceType>
pub fn resource(&self, name: impl AsRef<str>) -> Option<ResourceType>
Gets the resource in this interface with the given name, if any.
Sourcepub fn funcs(&self) -> impl Iterator<Item = (&str, Func)>
pub fn funcs(&self) -> impl Iterator<Item = (&str, Func)>
Iterates over all associated functions by name.
Sourcepub fn resources(&self) -> impl Iterator<Item = (&str, ResourceType)>
pub fn resources(&self) -> impl Iterator<Item = (&str, ResourceType)>
Iterates over all associated functions by name.
Trait Implementations§
Source§impl Clone for LinkerInstance
impl Clone for LinkerInstance
Source§fn clone(&self) -> LinkerInstance
fn clone(&self) -> LinkerInstance
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 LinkerInstance
impl Debug for LinkerInstance
Source§impl Default for LinkerInstance
impl Default for LinkerInstance
Source§fn default() -> LinkerInstance
fn default() -> LinkerInstance
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LinkerInstance
impl !RefUnwindSafe for LinkerInstance
impl Send for LinkerInstance
impl Sync for LinkerInstance
impl Unpin for LinkerInstance
impl !UnwindSafe for LinkerInstance
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