pub struct DiskDrive(pub Address);Expand description
The disk_drive component (3 methods).
Provided by OpenComputers’ DiskDrive, DiskDriveMountable, DiskDriveMountableBase.
Tuple Fields§
§0: AddressImplementations§
Source§impl DiskDrive
impl DiskDrive
Sourcepub fn eject(&self, velocity: Option<Number>) -> Result<bool>
pub fn eject(&self, velocity: Option<Number>) -> Result<bool>
Eject the currently present medium from the drive.
Lua: disk_drive.eject([velocity:number]):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn eject_async(&self, velocity: Option<Number>) -> Result<bool>
pub async fn eject_async(&self, velocity: Option<Number>) -> Result<bool>
Self::eject without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_empty(&self) -> Result<bool>
pub fn is_empty(&self) -> Result<bool>
Checks whether some medium is currently in the drive.
Lua: disk_drive.isEmpty():boolean
Indirect call: waits for the next server tick.
Sourcepub async fn is_empty_async(&self) -> Result<bool>
pub async fn is_empty_async(&self) -> Result<bool>
Self::is_empty without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn media(&self) -> Result<OcString>
pub fn media(&self) -> Result<OcString>
Return the internal floppy disk address
Lua: disk_drive.media(): string
Indirect call: waits for the next server tick.
Sourcepub async fn media_async(&self) -> Result<OcString>
pub async fn media_async(&self) -> Result<OcString>
Self::media 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 DiskDrive
impl Component for DiskDrive
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.