pub struct WorkspaceObject { /* private fields */ }Expand description
Safe wrapper for TestStand™ WorkspaceObject (IWorkspaceObject).
Implementations§
Source§impl WorkspaceObject
impl WorkspaceObject
Sourcepub fn display_name(&self) -> Result<String, Error>
pub fn display_name(&self) -> Result<String, Error>
Reads display name (WorkspaceObject.DisplayName).
§Errors
Error if the COM call fails or returns an unexpected type.
Examples found in repository?
examples/workspace_create.rs (line 13)
5fn main() -> Result<(), rs_teststand::Error> {
6 let engine = Engine::new()?;
7
8 println!("Creating a new workspace file...");
9 let ws_file = engine.new_workspace_file()?;
10 let root_obj = ws_file.root_workspace_object()?;
11
12 println!("Root workspace object:");
13 println!(" Display Name: '{}'", root_obj.display_name()?);
14 println!(" Object Type: {}", root_obj.object_type()?);
15 println!(" Child Objects: {}", root_obj.num_contained_objects()?);
16
17 println!("\nCreating project and folder structure...");
18 let project = root_obj.new_folder("Project Alpha")?;
19 println!(" Created project folder: '{}'", project.display_name()?);
20
21 let seq_entry = project.new_file("MainTest.seq")?;
22 println!(
23 " Created sequence file entry: '{}'",
24 seq_entry.display_name()?
25 );
26
27 println!(
28 "\nUpdated root child objects count: {}",
29 root_obj.num_contained_objects()?
30 );
31
32 Ok(())
33}Sourcepub fn file_exists(&self) -> Result<bool, Error>
pub fn file_exists(&self) -> Result<bool, Error>
Sourcepub fn object_type(&self) -> Result<i32, Error>
pub fn object_type(&self) -> Result<i32, Error>
Reads object type discriminant (WorkspaceObject.ObjectType).
§Errors
Error if the COM call fails or returns an unexpected type.
Examples found in repository?
examples/workspace_create.rs (line 14)
5fn main() -> Result<(), rs_teststand::Error> {
6 let engine = Engine::new()?;
7
8 println!("Creating a new workspace file...");
9 let ws_file = engine.new_workspace_file()?;
10 let root_obj = ws_file.root_workspace_object()?;
11
12 println!("Root workspace object:");
13 println!(" Display Name: '{}'", root_obj.display_name()?);
14 println!(" Object Type: {}", root_obj.object_type()?);
15 println!(" Child Objects: {}", root_obj.num_contained_objects()?);
16
17 println!("\nCreating project and folder structure...");
18 let project = root_obj.new_folder("Project Alpha")?;
19 println!(" Created project folder: '{}'", project.display_name()?);
20
21 let seq_entry = project.new_file("MainTest.seq")?;
22 println!(
23 " Created sequence file entry: '{}'",
24 seq_entry.display_name()?
25 );
26
27 println!(
28 "\nUpdated root child objects count: {}",
29 root_obj.num_contained_objects()?
30 );
31
32 Ok(())
33}Sourcepub fn num_contained_objects(&self) -> Result<i32, Error>
pub fn num_contained_objects(&self) -> Result<i32, Error>
Reads number of contained child objects (WorkspaceObject.NumContainedObjects).
§Errors
Error if the COM call fails or returns an unexpected type.
Examples found in repository?
examples/workspace_create.rs (line 15)
5fn main() -> Result<(), rs_teststand::Error> {
6 let engine = Engine::new()?;
7
8 println!("Creating a new workspace file...");
9 let ws_file = engine.new_workspace_file()?;
10 let root_obj = ws_file.root_workspace_object()?;
11
12 println!("Root workspace object:");
13 println!(" Display Name: '{}'", root_obj.display_name()?);
14 println!(" Object Type: {}", root_obj.object_type()?);
15 println!(" Child Objects: {}", root_obj.num_contained_objects()?);
16
17 println!("\nCreating project and folder structure...");
18 let project = root_obj.new_folder("Project Alpha")?;
19 println!(" Created project folder: '{}'", project.display_name()?);
20
21 let seq_entry = project.new_file("MainTest.seq")?;
22 println!(
23 " Created sequence file entry: '{}'",
24 seq_entry.display_name()?
25 );
26
27 println!(
28 "\nUpdated root child objects count: {}",
29 root_obj.num_contained_objects()?
30 );
31
32 Ok(())
33}Sourcepub fn get_contained_object(&self, index: i32) -> Result<Self, Error>
pub fn get_contained_object(&self, index: i32) -> Result<Self, Error>
Sourcepub fn get_absolute_path(&self) -> Result<String, Error>
pub fn get_absolute_path(&self) -> Result<String, Error>
Sourcepub fn new_file(&self, path_string: &str) -> Result<Self, Error>
pub fn new_file(&self, path_string: &str) -> Result<Self, Error>
Creates a new child file object (WorkspaceObject.NewFile).
§Errors
Error if the COM call fails or returns an unexpected type.
Examples found in repository?
examples/workspace_create.rs (line 21)
5fn main() -> Result<(), rs_teststand::Error> {
6 let engine = Engine::new()?;
7
8 println!("Creating a new workspace file...");
9 let ws_file = engine.new_workspace_file()?;
10 let root_obj = ws_file.root_workspace_object()?;
11
12 println!("Root workspace object:");
13 println!(" Display Name: '{}'", root_obj.display_name()?);
14 println!(" Object Type: {}", root_obj.object_type()?);
15 println!(" Child Objects: {}", root_obj.num_contained_objects()?);
16
17 println!("\nCreating project and folder structure...");
18 let project = root_obj.new_folder("Project Alpha")?;
19 println!(" Created project folder: '{}'", project.display_name()?);
20
21 let seq_entry = project.new_file("MainTest.seq")?;
22 println!(
23 " Created sequence file entry: '{}'",
24 seq_entry.display_name()?
25 );
26
27 println!(
28 "\nUpdated root child objects count: {}",
29 root_obj.num_contained_objects()?
30 );
31
32 Ok(())
33}Sourcepub fn new_folder(&self, folder_name: &str) -> Result<Self, Error>
pub fn new_folder(&self, folder_name: &str) -> Result<Self, Error>
Creates a new child folder object (WorkspaceObject.NewFolder).
§Errors
Error if the COM call fails or returns an unexpected type.
Examples found in repository?
examples/workspace_create.rs (line 18)
5fn main() -> Result<(), rs_teststand::Error> {
6 let engine = Engine::new()?;
7
8 println!("Creating a new workspace file...");
9 let ws_file = engine.new_workspace_file()?;
10 let root_obj = ws_file.root_workspace_object()?;
11
12 println!("Root workspace object:");
13 println!(" Display Name: '{}'", root_obj.display_name()?);
14 println!(" Object Type: {}", root_obj.object_type()?);
15 println!(" Child Objects: {}", root_obj.num_contained_objects()?);
16
17 println!("\nCreating project and folder structure...");
18 let project = root_obj.new_folder("Project Alpha")?;
19 println!(" Created project folder: '{}'", project.display_name()?);
20
21 let seq_entry = project.new_file("MainTest.seq")?;
22 println!(
23 " Created sequence file entry: '{}'",
24 seq_entry.display_name()?
25 );
26
27 println!(
28 "\nUpdated root child objects count: {}",
29 root_obj.num_contained_objects()?
30 );
31
32 Ok(())
33}Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WorkspaceObject
impl !Send for WorkspaceObject
impl !Sync for WorkspaceObject
impl !UnwindSafe for WorkspaceObject
impl Freeze for WorkspaceObject
impl Unpin for WorkspaceObject
impl UnsafeUnpin for WorkspaceObject
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