Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update prior to release #145

Merged
merged 6 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/openvino/src/core.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Define the core interface between Rust and OpenVINO's C
//! [API](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__core__c__api.html).
//! [API](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__core__c__api.html).

use crate::error::LoadingError;
use crate::{cstr, drop_using_function, try_unsafe, util::Result};
Expand All @@ -16,7 +16,7 @@ use std::os::raw::c_char;
use std::slice;
use std::str::FromStr;

/// See [`Core`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__core__c__api.html).
/// See [`ov_core_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__core__c__api.html).
pub struct Core {
ptr: *mut ov_core_t,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/device_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum DeviceType<'a> {
GPU,
/// [NPU Device](https://docs.openvino.ai/2024/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.html)
NPU,
/// [GNA Device](https://docs.openvino.ai/2023.3/openvino_docs_OV_UG_supported_plugins_GNA.html)
/// [GNA Device](https://docs.openvino.ai/2024/openvino_docs_OV_UG_supported_plugins_GNA.html)
#[deprecated = "Deprecated since OpenVINO 2024.0; use NPU device instead"]
GNA,
/// Arbitrary device.
Expand Down
3 changes: 2 additions & 1 deletion crates/openvino/src/dimension.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use openvino_sys::{ov_dimension_is_dynamic, ov_dimension_t};

/// See [`Dimension`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__dimension__c__api.html).
/// See
/// [`ov_dimension_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__dimension__c__api.html).
#[derive(Copy, Clone, Debug)]
#[repr(transparent)]
pub struct Dimension {
Expand Down
3 changes: 2 additions & 1 deletion crates/openvino/src/element_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use std::convert::TryFrom;
use std::error::Error;
use std::fmt;

/// `ElementType` represents the type of elements that a tensor can hold. See [`ElementType`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__base__c__api.html#_CPPv417ov_element_type_e).
/// See
/// [`ov_element_type_e`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__base__c__api.html#_CPPv417ov_element_type_e).
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u32)]
pub enum ElementType {
Expand Down
5 changes: 3 additions & 2 deletions crates/openvino/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use std::error::Error;
use std::fmt;

/// Enumerate errors returned by the OpenVINO implementation. See
/// [`OvStatusCode`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__base__c__api.html#_CPPv411ov_status_e).
/// See
/// [`ov_status_e`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__base__c__api.html#_CPPv411ov_status_e);
/// enumerates errors returned by the OpenVINO implementation.
#[allow(missing_docs)]
#[derive(Debug, PartialEq, Eq)]
pub enum InferenceError {
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/layout.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{cstr, drop_using_function, try_unsafe, util::Result};
use openvino_sys::{ov_layout_create, ov_layout_free, ov_layout_t};

/// See [`Layout`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__layout__c__api.html).
/// See [`ov_layout_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__layout__c__api.html).
pub struct Layout {
ptr: *mut ov_layout_t,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub use shape::Shape;
pub use tensor::Tensor;
pub use version::Version;

/// Emit the version string of the OpenVINO C API backing this implementation.
/// Emit the version of the OpenVINO C library backing this implementation.
///
/// # Panics
///
Expand Down
5 changes: 3 additions & 2 deletions crates/openvino/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use openvino_sys::{
use std::borrow::Cow;
use std::ffi::CStr;

/// See [`Model`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__model__c__api.html).
/// See [`ov_model_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__model__c__api.html).
pub struct Model {
ptr: *mut ov_model_t,
}
Expand Down Expand Up @@ -92,7 +92,8 @@ impl Model {
}
}

/// See [`CompiledModel`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__compiled__model__c__api.html).
/// See
/// [`ov_compiled_model_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__compiled__model__c__api.html).
pub struct CompiledModel {
ptr: *mut ov_compiled_model_t,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use openvino_sys::{

use std::{convert::TryInto as _, ffi::CStr};

/// See [`Node`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__node__c__api.html).
/// See [`ov_node_c_api`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__node__c__api.html).
pub struct Node {
ptr: *mut ov_output_const_port_t,
}
Expand Down
3 changes: 2 additions & 1 deletion crates/openvino/src/partial_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use openvino_sys::{

use std::convert::TryInto;

/// See [`PartialShape`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__partial__shape__c__api.html).
/// See
/// [`ov_partial_shape_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__partial__shape__c__api.html).
pub struct PartialShape {
c_struct: ov_partial_shape_t,
}
Expand Down
27 changes: 18 additions & 9 deletions crates/openvino/src/prepostprocess.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! See [`PrePostProcess`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__prepostprocess__c__api.html#).
//! See
//! [`ov_prepostprocess_c_api`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__prepostprocess__c__api.html#).
//!
//! See [`PrePostProcess Walkthrough`](https://docs.openvino.ai/2022.3/openvino_docs_OV_UG_Preprocessing_Overview.html).
//! For more information, read through the [`PrePostProcess
//! Walkthrough`](https://docs.openvino.ai/2022.3/openvino_docs_OV_UG_Preprocessing_Overview.html).
//!
//! ```
//! # use openvino::{prepostprocess, Core, ElementType, Layout, Shape, Tensor, ResizeAlgorithm};
Expand Down Expand Up @@ -55,7 +57,8 @@ use openvino_sys::{
ov_preprocess_preprocess_steps_resize, ov_preprocess_preprocess_steps_t,
};

/// See [`PrePostProcess`](https://docs.openvino.ai/2023.3/api/c_cpp_api/structov__preprocess__prepostprocessor__t.html).
/// See
/// [`ov_preprocess_prepostprocessor_t`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__preprocess__prepostprocessor__t.html).
#[derive(Debug)]
pub struct Pipeline {
ptr: *mut ov_preprocess_prepostprocessor_t,
Expand Down Expand Up @@ -147,7 +150,8 @@ impl Pipeline {
}
}

/// See [`PreProcessInputInfo`](https://docs.openvino.ai/2023.3/api/c_cpp_api/structov__preprocess__input__info__t.html).
/// See
/// [`ov_preprocess_input_info_t`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__preprocess__input__info__t.html).
pub struct InputInfo {
ptr: *mut ov_preprocess_input_info_t,
}
Expand Down Expand Up @@ -185,7 +189,8 @@ impl InputInfo {
}
}

/// See [`PreprocessOutputInfo`](https://docs.openvino.ai/2023.3/api/c_cpp_api/structov__preprocess__output__info__t.html).
/// See
/// [`ov_preprocess_output_info_t`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__preprocess__output__info__t.html).
pub struct OutputInfo {
ptr: *mut ov_preprocess_output_info_t,
}
Expand All @@ -202,7 +207,8 @@ impl OutputInfo {
}
}

/// See [`PreprocessInputModelInfo`](https://docs.openvino.ai/2023.3/api/c_cpp_api/structov__preprocess__input__model__info__t.html).
/// See
/// [`ov_preprocess_input_model_info_t`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__preprocess__input__model__info__t.html).
pub struct InputModelInfo {
ptr: *mut ov_preprocess_input_model_info_t,
}
Expand All @@ -217,7 +223,8 @@ impl InputModelInfo {
}
}

/// See [`PreprocessInputTensorInfo`](https://docs.openvino.ai/2023.3/api/c_cpp_api/structov__preprocess__input__tensor__info__t.html).
/// See
/// [`ov_preprocess_input_tensor_info_t`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__preprocess__input__tensor__info__t.html).
pub struct InputTensorInfo {
ptr: *mut ov_preprocess_input_tensor_info_t,
}
Expand All @@ -240,7 +247,8 @@ impl InputTensorInfo {
}
}

/// See [`PreprocessOutputTensorInfo`](https://docs.openvino.ai/2023.3/api/c_cpp_api/structov__preprocess__output__tensor__info__t.html).
/// See
/// [`ov_preprocess_output_tensor_info_t`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__preprocess__output__tensor__info__t.html).
pub struct OutputTensorInfo {
ptr: *mut ov_preprocess_output_tensor_info_t,
}
Expand All @@ -255,7 +263,8 @@ impl OutputTensorInfo {
}
}

/// See [`PreprocessSteps`](https://docs.openvino.ai/2023.3/api/c_cpp_api/structov__preprocess__preprocess__steps__t.html).
/// See
/// [`ov_preprocess_preprocess_steps_t`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__preprocess__preprocess__steps__t.html).
pub struct Steps {
ptr: *mut ov_preprocess_preprocess_steps_t,
}
Expand Down
3 changes: 2 additions & 1 deletion crates/openvino/src/property.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::borrow::Cow;

/// See [`Property`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__property__c__api.html).
/// See
/// [`ov_property_c_api`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__property__c__api.html).
/// `PropertyKey` represents valid configuration properties for a [`crate::Core`] instance.
#[derive(Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
pub enum PropertyKey {
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/rank.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use openvino_sys::{ov_rank_is_dynamic, ov_rank_t};

/// See [`Rank`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__rank__c__api.html).
/// See [`ov_rank_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__rank__c__api.html).
#[derive(Copy, Clone, Debug)]
#[repr(transparent)]
pub struct Rank {
Expand Down
3 changes: 2 additions & 1 deletion crates/openvino/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use openvino_sys::{
ov_infer_request_start_async, ov_infer_request_t, ov_infer_request_wait_for,
};

/// See [`InferRequest`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__infer__request__c__api.html).
/// See
/// [`ov_infer_request_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__infer__request__c__api.html).
pub struct InferRequest {
ptr: *mut ov_infer_request_t,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{try_unsafe, util::Result};
use openvino_sys::{ov_shape_create, ov_shape_free, ov_shape_t};
use std::convert::TryInto;

/// See [`Shape`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__shape__c__api.html).
/// See [`ov_shape_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__shape__c__api.html).
pub struct Shape {
c_struct: ov_shape_t,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use openvino_sys::{
ov_tensor_t,
};

/// See [`Tensor`](https://docs.openvino.ai/2023.3/api/c_cpp_api/group__ov__tensor__c__api.html).
/// See [`ov_tensor_t`](https://docs.openvino.ai/2024/api/c_cpp_api/group__ov__tensor__c__api.html).
///
/// To create a tensor from in-memory data, construct it and then fill it:
///
Expand Down
3 changes: 3 additions & 0 deletions crates/openvino/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::InferenceError;
pub(crate) type Result<T> = std::result::Result<T, InferenceError>;

/// Convert a Rust string into a string to pass across the C boundary.
#[doc(hidden)]
#[macro_export]
macro_rules! cstr {
($str: expr) => {
Expand All @@ -13,6 +14,7 @@ macro_rules! cstr {
}

/// Convert an unsafe call to openvino-sys into an [`InferenceError`].
#[doc(hidden)]
#[macro_export]
macro_rules! try_unsafe {
($e: expr) => {
Expand All @@ -22,6 +24,7 @@ macro_rules! try_unsafe {

/// Drop one of the Rust wrapper structures using the provided free function. This relies on all
/// Rust wrapper functions having a `ptr` field pointing to their OpenVINO C structure.
#[doc(hidden)]
#[macro_export]
macro_rules! drop_using_function {
($ty: ty, $free_fn: expr) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/openvino/src/version.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use openvino_sys::ov_version_t;

/// Represents OpenVINO version information.
/// See [`ov_version`](https://docs.openvino.ai/2024/api/c_cpp_api/structov__version.html).
pub struct Version {
/// A string representing OpenVINO version.
pub build_number: String,
Expand Down
Loading