pub struct Generator(pub Address);Expand description
The generator component (3 methods).
Provided by OpenComputers’ UpgradeGenerator.
Tuple Fields§
§0: AddressImplementations§
Source§impl Generator
impl Generator
Sourcepub fn count(&self) -> Result<Number>
pub fn count(&self) -> Result<Number>
Get the size of the item stack in the generator’s queue.
Lua: generator.count():number
Indirect call: waits for the next server tick.
Sourcepub async fn count_async(&self) -> Result<Number>
pub async fn count_async(&self) -> Result<Number>
Self::count without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn insert(&self, count: Option<Number>) -> Result<bool>
pub fn insert(&self, count: Option<Number>) -> Result<bool>
Tries to insert fuel from the selected slot into the generator’s queue.
Lua: generator.insert([count:number]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn insert_async(&self, count: Option<Number>) -> Result<bool>
pub async fn insert_async(&self, count: Option<Number>) -> Result<bool>
Self::insert without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn remove(&self, count: Option<Number>) -> Result<bool>
pub fn remove(&self, count: Option<Number>) -> Result<bool>
Tries to remove items from the generator’s queue.
Lua: generator.remove([count:number]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn remove_async(&self, count: Option<Number>) -> Result<bool>
pub async fn remove_async(&self, count: Option<Number>) -> Result<bool>
Self::remove without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Trait Implementations§
Source§impl Component for Generator
impl Component for Generator
Source§fn from_address(address: Address) -> Self
fn from_address(address: Address) -> Self
fn address(&self) -> &Address
Source§fn at(address: impl Into<Address>) -> Option<Self>
fn at(address: impl Into<Address>) -> Option<Self>
address, if it is of this type.Source§fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
Source§fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
Component::invoke without blocking; see invoke_async.