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).
- Method
Info - A method’s attributes, from
methods. - Proxy
- Any component, called by method name.
Traits§
- Component
- A typed component wrapper.
- From
Reply - Turns a reply into a method’s documented return type. OpenComputers
methods report failure as
nil, "reason"(orfalse, "reason"for some boolean methods); decoding into a non-optional type turns the first intoError::Failed. - From
Value - One returned value.
Functions§
- invoke
- Calls
methodon the component ataddress. - invoke_
async - Like
invoke, but without blocking: queues the call and returns a future for its result. Must be awaited insidecrate::task::run. Requires theasyncfeature. - invoke_
value - Calls
methodon a userdata value, such as the request objectinternet.requestreturns (Lua’shandle.read()). A value that was released isError::NoSuchComponent. - invoke_
value_ async - Like
invoke_value, but without blocking; seeinvoke_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.