pub struct BioLibApp { /* private fields */ }Implementations§
Source§impl BioLibApp
impl BioLibApp
pub fn load(uri: &str) -> Result<Self>
pub fn load_with_client(uri: &str, api_client: ApiClient) -> Result<Self>
Sourcepub fn uri(&self) -> &str
pub fn uri(&self) -> &str
Examples found in repository?
examples/run_app.rs (line 5)
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}pub fn uuid(&self) -> &str
pub fn version(&self) -> &AppVersion
Sourcepub fn cli(
&self,
args: Option<Vec<String>>,
stdin: Option<Vec<u8>>,
files: Option<HashMap<String, Vec<u8>>>,
blocking: bool,
) -> Result<Job>
pub fn cli( &self, args: Option<Vec<String>>, stdin: Option<Vec<u8>>, files: Option<HashMap<String, Vec<u8>>>, blocking: bool, ) -> Result<Job>
Examples found in repository?
examples/run_app.rs (line 7)
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}Auto Trait Implementations§
impl Freeze for BioLibApp
impl !RefUnwindSafe for BioLibApp
impl Send for BioLibApp
impl Sync for BioLibApp
impl Unpin for BioLibApp
impl UnsafeUnpin for BioLibApp
impl !UnwindSafe for BioLibApp
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