pub struct Jukebox(pub Address);Expand description
The jukebox component (3 methods).
Provided by OpenComputers’ DriverRecordPlayer$Environment.
Tuple Fields§
§0: AddressImplementations§
Source§impl Jukebox
impl Jukebox
Sourcepub fn get_record(&self) -> Result<OcString>
pub fn get_record(&self) -> Result<OcString>
Get the title of the record currently in the jukebox.
Lua: jukebox.getRecord():string
Indirect call: waits for the next server tick.
Sourcepub async fn get_record_async(&self) -> Result<OcString>
pub async fn get_record_async(&self) -> Result<OcString>
Self::get_record without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn play(&self) -> Result<()>
pub fn play(&self) -> Result<()>
Start playing the record currently in the jukebox.
Lua: jukebox.play()
Indirect call: waits for the next server tick.
Sourcepub async fn play_async(&self) -> Result<()>
pub async fn play_async(&self) -> Result<()>
Self::play without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn stop(&self) -> Result<()>
pub fn stop(&self) -> Result<()>
Stop playing the record currently in the jukebox.
Lua: jukebox.stop()
Indirect call: waits for the next server tick.
Sourcepub async fn stop_async(&self) -> Result<()>
pub async fn stop_async(&self) -> Result<()>
Self::stop 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 Jukebox
impl Component for Jukebox
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.