Struct fahapi::API [−][src]
Wrapper for the FAH API. Use API::connect_timeout() to initialize.
Example
fn example() -> fahapi::Result<()> { let mut api = fahapi::API::connect_timeout(&fahapi::DEFAULT_ADDR, std::time::Duration::from_secs(1))?; api.pause_all()?; api.unpause_all() }
Fields
conn: Connection
buf: Vec<u8>
Implementations
impl API
[src]
pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> Result<API>
[src]
Connects to your FAH client with a timeout. DEFAULT_ADDR
is the default address.
pub fn help(&mut self) -> Result<String>
[src]
Returns a listing of the FAH API commands.
pub fn log_updates(&mut self, arg: LogUpdatesArg) -> Result<String>
[src]
Enables or disables log updates. Returns current log.
pub fn screensaver(&mut self) -> Result<()>
[src]
Unpauses all slots which are paused waiting for a screensaver and pause them again on disconnect.
pub fn always_on(&mut self, slot: i64) -> Result<()>
[src]
Sets a slot to be always on.
pub fn configured(&mut self) -> Result<bool>
[src]
Returns true if the client has set a user, team or passkey.
pub fn do_cycle(&mut self) -> Result<()>
[src]
Runs one client cycle.
pub fn finish_slot(&mut self, slot: i64) -> Result<()>
[src]
Pauses a slot when its current work unit is completed.
pub fn finish_all(&mut self) -> Result<()>
[src]
Pauses all slots one-by-one when their current work unit is completed.
pub fn info(&mut self) -> Result<Vec<Vec<Value>>>
[src]
Returns FAH build and machine info. See info_struct()
.
pub fn info_struct(&mut self) -> Result<Info>
[src]
Converts Info() data into a structure. Consider this interface to be very unstable.
pub fn num_slots(&mut self) -> Result<i64>
[src]
Returns the number of slots.
pub fn on_idle(&mut self, slot: i64) -> Result<()>
[src]
Sets a slot to run only when idle.
pub fn on_idle_all(&mut self) -> Result<()>
[src]
Sets all slots to run only when idle.
pub fn options_get(&mut self) -> Result<Options>
[src]
Returns the FAH client options.
pub fn options_set<N>(&mut self, key: &str, value: N) -> Result<()> where
N: Display,
[src]
N: Display,
Sets an option.
pub fn pause_all(&mut self) -> Result<()>
[src]
Pauses all slots.
pub fn pause_slot(&mut self, slot: i64) -> Result<()>
[src]
Pauses a slot.
pub fn ppd(&mut self) -> Result<f64>
[src]
pub fn queue_info(&mut self) -> Result<Vec<SlotQueueInfo>>
[src]
Returns info about the current work unit.
pub fn request_id(&mut self) -> Result<()>
[src]
Requests an ID from the assignment server.
pub fn request_ws(&mut self) -> Result<()>
[src]
Requests work server assignment from the assignment server.
pub fn shutdown(&mut self) -> Result<()>
[src]
Ends all FAH processes.
pub fn simulation_info(&mut self, slot: i64) -> Result<SimulationInfo>
[src]
Returns the simulation information for a slot.
pub fn slot_delete(&mut self, slot: i64) -> Result<()>
[src]
Deletes a slot.
pub fn slot_info(&mut self) -> Result<Vec<SlotInfo>>
[src]
Returns information about each slot.
pub fn slot_options_get(&mut self, slot: i64) -> Result<SlotOptions>
[src]
Returns slot options.
pub fn slot_options_set<N>(
&mut self,
slot: i64,
key: &str,
value: N
) -> Result<()> where
N: Display,
[src]
&mut self,
slot: i64,
key: &str,
value: N
) -> Result<()> where
N: Display,
Sets slot option.
pub fn unpause_all(&mut self) -> Result<()>
[src]
Unpauses all slots.
pub fn unpause_slot(&mut self, slot: i64) -> Result<()>
[src]
Unpauses a slot.
pub fn uptime(&mut self) -> Result<FAHDuration>
[src]
Returns FAH uptime.
pub fn wait_for_units(&mut self) -> Result<()>
[src]
Blocks until all slots are paused.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for API
[src]
impl Send for API
[src]
impl Sync for API
[src]
impl Unpin for API
[src]
impl UnwindSafe for API
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,