Skip to main content

Module component

Module component 

Source
Expand description

Finding components and calling them.

Every typed wrapper in crate::components implements Component. The untyped way, for anything the wrappers don’t cover (another mod’s components, say), is Proxy or invoke.

Structs§

Address
A component’s address (a UUID string).
MethodInfo
A method’s attributes, from methods.
Proxy
Any component, called by method name.

Traits§

Component
A typed component wrapper.
FromReply
Turns a reply into a method’s documented return type. OpenComputers methods report failure as nil, "reason" (or false, "reason" for some boolean methods); decoding into a non-optional type turns the first into Error::Failed.
FromValue
One returned value.

Functions§

invoke
Calls method on the component at address.
invoke_async
Like invoke, but without blocking: queues the call and returns a future for its result. Must be awaited inside crate::task::run. Requires the async feature.
invoke_value
Calls method on a userdata value, such as the request object internet.request returns (Lua’s handle.read()). A value that was released is Error::NoSuchComponent.
invoke_value_async
Like invoke_value, but without blocking; see invoke_async.
list
Every component whose type contains filter (all of them for ""), as (address, type) pairs sorted by address.
methods
The methods a component offers, sorted by name.
release_value
Tells the host this program is done with value. The host disposes of it (an open socket is closed) and the handle stops working. Values that are never released stay alive until the computer stops.