pub struct Job { /* private fields */ }Implementations§
Source§impl Job
impl Job
pub fn from_uuid( _api_client: &ApiClient, uuid: &str, auth_token: Option<&str>, ) -> Result<Self>
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
Examples found in repository?
examples/run_app.rs (line 78)
71fn _example_non_blocking() {
72 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
73
74 let mut job = app
75 .cli(None, None, None, false)
76 .expect("Failed to start job");
77
78 println!("Job ID: {}", job.id());
79 println!("Share link: {}", job.get_shareable_link());
80
81 job.wait(None).expect("Failed to wait for job");
82
83 let exit_code = job.get_exit_code().unwrap();
84 println!("Exit code: {exit_code}");
85}pub fn auth_token(&self) -> &str
pub fn app_uri(&self) -> Option<&str>
pub fn get_status(&mut self) -> Result<String>
pub fn is_finished(&mut self) -> Result<bool>
Sourcepub fn wait(&mut self, timeout: Option<u64>) -> Result<()>
pub fn wait(&mut self, timeout: Option<u64>) -> Result<()>
Examples found in repository?
examples/run_app.rs (line 81)
71fn _example_non_blocking() {
72 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
73
74 let mut job = app
75 .cli(None, None, None, false)
76 .expect("Failed to start job");
77
78 println!("Job ID: {}", job.id());
79 println!("Share link: {}", job.get_shareable_link());
80
81 job.wait(None).expect("Failed to wait for job");
82
83 let exit_code = job.get_exit_code().unwrap();
84 println!("Exit code: {exit_code}");
85}Sourcepub fn get_stdout(&mut self) -> Result<Vec<u8>>
pub fn get_stdout(&mut self) -> Result<Vec<u8>>
Examples found in repository?
examples/run_app.rs (line 10)
3fn main() {
4 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
5 println!("Loaded app: {}", app.uri());
6
7 let mut job = app.cli(None, None, None, true).expect("Failed to run app");
8
9 let exit_code = job.get_exit_code().expect("Failed to get exit code");
10 let stdout = job.get_stdout().expect("Failed to get stdout");
11 let stderr = job.get_stderr().expect("Failed to get stderr");
12
13 println!("Exit code: {exit_code}");
14 println!("Stdout: {}", String::from_utf8_lossy(&stdout));
15 if !stderr.is_empty() {
16 eprintln!("Stderr: {}", String::from_utf8_lossy(&stderr));
17 }
18
19 let files = job.list_output_files().expect("Failed to list files");
20 for file in &files {
21 println!("Output file: {}", file.path);
22 }
23}
24
25fn _example_with_args() {
26 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
27
28 let args = vec!["--name".to_string(), "World".to_string()];
29 let mut job = app
30 .cli(Some(args), None, None, true)
31 .expect("Failed to run app");
32
33 println!(
34 "Stdout: {}",
35 String::from_utf8_lossy(&job.get_stdout().unwrap())
36 );
37}
38
39fn _example_with_files() {
40 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
41
42 let mut files = HashMap::new();
43 files.insert("input.txt".to_string(), b"Hello from file".to_vec());
44
45 let mut job = app
46 .cli(None, None, Some(files), true)
47 .expect("Failed to run app");
48
49 let exit_code = job.get_exit_code().unwrap();
50 println!("Exit code: {exit_code}");
51
52 job.save_files("output_dir", true)
53 .expect("Failed to save files");
54}
55
56fn _example_search() {
57 let results = biolib::search(Some("hello"), None, 5).expect("Search failed");
58 for uri in &results {
59 println!("Found: {uri}");
60 }
61}
62
63fn _example_get_result() {
64 let job_id = "some-job-uuid";
65 let mut job = biolib::get_result(job_id, None).expect("Failed to get result");
66
67 let stdout = job.get_stdout().expect("Failed to get stdout");
68 println!("Stdout: {}", String::from_utf8_lossy(&stdout));
69}Sourcepub fn get_stderr(&mut self) -> Result<Vec<u8>>
pub fn get_stderr(&mut self) -> Result<Vec<u8>>
Examples found in repository?
examples/run_app.rs (line 11)
3fn main() {
4 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
5 println!("Loaded app: {}", app.uri());
6
7 let mut job = app.cli(None, None, None, true).expect("Failed to run app");
8
9 let exit_code = job.get_exit_code().expect("Failed to get exit code");
10 let stdout = job.get_stdout().expect("Failed to get stdout");
11 let stderr = job.get_stderr().expect("Failed to get stderr");
12
13 println!("Exit code: {exit_code}");
14 println!("Stdout: {}", String::from_utf8_lossy(&stdout));
15 if !stderr.is_empty() {
16 eprintln!("Stderr: {}", String::from_utf8_lossy(&stderr));
17 }
18
19 let files = job.list_output_files().expect("Failed to list files");
20 for file in &files {
21 println!("Output file: {}", file.path);
22 }
23}Sourcepub fn get_exit_code(&mut self) -> Result<u16>
pub fn get_exit_code(&mut self) -> Result<u16>
Examples found in repository?
examples/run_app.rs (line 9)
3fn main() {
4 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
5 println!("Loaded app: {}", app.uri());
6
7 let mut job = app.cli(None, None, None, true).expect("Failed to run app");
8
9 let exit_code = job.get_exit_code().expect("Failed to get exit code");
10 let stdout = job.get_stdout().expect("Failed to get stdout");
11 let stderr = job.get_stderr().expect("Failed to get stderr");
12
13 println!("Exit code: {exit_code}");
14 println!("Stdout: {}", String::from_utf8_lossy(&stdout));
15 if !stderr.is_empty() {
16 eprintln!("Stderr: {}", String::from_utf8_lossy(&stderr));
17 }
18
19 let files = job.list_output_files().expect("Failed to list files");
20 for file in &files {
21 println!("Output file: {}", file.path);
22 }
23}
24
25fn _example_with_args() {
26 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
27
28 let args = vec!["--name".to_string(), "World".to_string()];
29 let mut job = app
30 .cli(Some(args), None, None, true)
31 .expect("Failed to run app");
32
33 println!(
34 "Stdout: {}",
35 String::from_utf8_lossy(&job.get_stdout().unwrap())
36 );
37}
38
39fn _example_with_files() {
40 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
41
42 let mut files = HashMap::new();
43 files.insert("input.txt".to_string(), b"Hello from file".to_vec());
44
45 let mut job = app
46 .cli(None, None, Some(files), true)
47 .expect("Failed to run app");
48
49 let exit_code = job.get_exit_code().unwrap();
50 println!("Exit code: {exit_code}");
51
52 job.save_files("output_dir", true)
53 .expect("Failed to save files");
54}
55
56fn _example_search() {
57 let results = biolib::search(Some("hello"), None, 5).expect("Search failed");
58 for uri in &results {
59 println!("Found: {uri}");
60 }
61}
62
63fn _example_get_result() {
64 let job_id = "some-job-uuid";
65 let mut job = biolib::get_result(job_id, None).expect("Failed to get result");
66
67 let stdout = job.get_stdout().expect("Failed to get stdout");
68 println!("Stdout: {}", String::from_utf8_lossy(&stdout));
69}
70
71fn _example_non_blocking() {
72 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
73
74 let mut job = app
75 .cli(None, None, None, false)
76 .expect("Failed to start job");
77
78 println!("Job ID: {}", job.id());
79 println!("Share link: {}", job.get_shareable_link());
80
81 job.wait(None).expect("Failed to wait for job");
82
83 let exit_code = job.get_exit_code().unwrap();
84 println!("Exit code: {exit_code}");
85}Sourcepub fn list_output_files(&mut self) -> Result<Vec<OutputFile>>
pub fn list_output_files(&mut self) -> Result<Vec<OutputFile>>
Examples found in repository?
examples/run_app.rs (line 19)
3fn main() {
4 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
5 println!("Loaded app: {}", app.uri());
6
7 let mut job = app.cli(None, None, None, true).expect("Failed to run app");
8
9 let exit_code = job.get_exit_code().expect("Failed to get exit code");
10 let stdout = job.get_stdout().expect("Failed to get stdout");
11 let stderr = job.get_stderr().expect("Failed to get stderr");
12
13 println!("Exit code: {exit_code}");
14 println!("Stdout: {}", String::from_utf8_lossy(&stdout));
15 if !stderr.is_empty() {
16 eprintln!("Stderr: {}", String::from_utf8_lossy(&stderr));
17 }
18
19 let files = job.list_output_files().expect("Failed to list files");
20 for file in &files {
21 println!("Output file: {}", file.path);
22 }
23}Sourcepub fn save_files(&mut self, output_dir: &str, overwrite: bool) -> Result<()>
pub fn save_files(&mut self, output_dir: &str, overwrite: bool) -> Result<()>
Examples found in repository?
examples/run_app.rs (line 52)
39fn _example_with_files() {
40 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
41
42 let mut files = HashMap::new();
43 files.insert("input.txt".to_string(), b"Hello from file".to_vec());
44
45 let mut job = app
46 .cli(None, None, Some(files), true)
47 .expect("Failed to run app");
48
49 let exit_code = job.get_exit_code().unwrap();
50 println!("Exit code: {exit_code}");
51
52 job.save_files("output_dir", true)
53 .expect("Failed to save files");
54}pub fn cancel(&mut self) -> Result<()>
pub fn delete(&mut self) -> Result<()>
pub fn rename(&mut self, name: &str) -> Result<()>
Examples found in repository?
examples/run_app.rs (line 79)
71fn _example_non_blocking() {
72 let app = biolib::load("test-team/hello-world:0.0.2").expect("Failed to load app");
73
74 let mut job = app
75 .cli(None, None, None, false)
76 .expect("Failed to start job");
77
78 println!("Job ID: {}", job.id());
79 println!("Share link: {}", job.get_shareable_link());
80
81 job.wait(None).expect("Failed to wait for job");
82
83 let exit_code = job.get_exit_code().unwrap();
84 println!("Exit code: {exit_code}");
85}pub fn stream_logs(&mut self) -> Result<()>
pub fn start_in_cloud( _api_client: &ApiClient, app_uri: &str, app_version_uuid: &str, module_input: &[u8], override_command: bool, machine: Option<&str>, experiment_id: Option<&str>, result_prefix: Option<&str>, timeout: Option<u64>, notify: bool, requested_machine_count: Option<u32>, ) -> Result<Self>
pub fn fetch_jobs( _api_client: &ApiClient, count: usize, status: Option<&str>, ) -> Result<Vec<Job>>
Auto Trait Implementations§
impl Freeze for Job
impl !RefUnwindSafe for Job
impl !Send for Job
impl !Sync for Job
impl Unpin for Job
impl UnsafeUnpin for Job
impl !UnwindSafe for Job
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more