File tree Expand file tree Collapse file tree 3 files changed +33
-33
lines changed Expand file tree Collapse file tree 3 files changed +33
-33
lines changed Original file line number Diff line number Diff line change
1
+ //! This crate provides low-level, unsafe, Rust bindings to OpenVINO™ using its [C API]. If you are
2
+ //! looking to use OpenVINO™ from Rust, you likely should look at the ergonomic, safe bindings in
3
+ //! [openvino], which depends on this crate. See the repository [README] for more information,
4
+ //! including build instructions.
5
+ //!
6
+ //! [C API]: https://docs.openvinotoolkit.org/2020.1/ie_c_api/groups.html
7
+ //! [openvino-sys]: https://crates.io/crates/openvino-sys
8
+ //! [openvino]: https://crates.io/crates/openvino
9
+ //! [README]: https://github.com/intel/openvino-rs/tree/main/crates/openvino-sys
10
+ //!
11
+ //! An example interaction with raw [openvino-sys]:
12
+ //! ```
13
+ //! # use std::ffi::CStr;
14
+ //! openvino_sys::library::load().expect("to have an OpenVINO library available");
15
+ //! let version = unsafe { CStr::from_ptr(openvino_sys::ie_c_api_version().api_version) };
16
+ //! assert!(version.to_string_lossy().starts_with("2.1"));
17
+ //! ```
1
18
#![ allow( non_upper_case_globals) ]
2
19
#![ allow( non_camel_case_types) ]
3
20
#![ allow( non_snake_case) ]
@@ -38,16 +55,3 @@ pub mod library {
38
55
}
39
56
}
40
57
}
41
-
42
- #[ cfg( test) ]
43
- mod tests {
44
- use super :: * ;
45
- use std:: ffi:: CStr ;
46
-
47
- #[ test]
48
- fn check_version ( ) {
49
- load ( ) . expect ( "to have an OpenVINO library available" ) ;
50
- let version = unsafe { CStr :: from_ptr ( ie_c_api_version ( ) . api_version ) } ;
51
- assert ! ( version. to_string_lossy( ) . starts_with( "2.1" ) ) ;
52
- }
53
- }
Original file line number Diff line number Diff line change @@ -105,13 +105,3 @@ impl Core {
105
105
Ok ( ExecutableNetwork { instance } )
106
106
}
107
107
}
108
-
109
- #[ cfg( test) ]
110
- mod tests {
111
- use super :: * ;
112
-
113
- #[ test]
114
- fn construct_core ( ) {
115
- let _ = Core :: new ( None ) . unwrap ( ) ;
116
- }
117
- }
Original file line number Diff line number Diff line change
1
+ //! The [openvino] crate provides high-level, ergonomic, safe Rust bindings to OpenVINO. See the
2
+ //! repository [README] for more information, such as build instructions.
3
+ //!
4
+ //! [openvino]: https://crates.io/crates/openvino
5
+ //! [README]: https://github.com/intel/openvino-rs
6
+ //!
7
+ //! Check the loaded version of OpenVINO:
8
+ //! ```
9
+ //! assert!(openvino::version().starts_with("2.1"))
10
+ //! ```
11
+ //!
12
+ //! Most interaction with OpenVINO begins with instantiating a [Core]:
13
+ //! ```
14
+ //! let _ = openvino::Core::new(None).expect("to instantiate the OpenVINO library");
15
+ //! ```
16
+
1
17
mod blob;
2
18
mod core;
3
19
mod error;
@@ -29,13 +45,3 @@ pub fn version() -> String {
29
45
unsafe { openvino_sys:: ie_version_free ( & mut ie_version as * mut openvino_sys:: ie_version_t ) } ;
30
46
str_version
31
47
}
32
-
33
- #[ cfg( test) ]
34
- mod tests {
35
- use super :: * ;
36
-
37
- #[ test]
38
- fn check_version ( ) {
39
- assert ! ( version( ) . starts_with( "2.1" ) , )
40
- }
41
- }
You can’t perform that action at this time.
0 commit comments