nv-redfish 0.9.1

Rust implementation of Redfish API for BMC management
Documentation
// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Redfish protocol client
//!
//! This crate provides a thin, ergonomic layer on top of generated Redfish
//! schema types and the `nv-redfish-core` primitives. It focuses on:
//! - High-level entry points (for example, [`ServiceRoot`])
//! - Modular, feature-gated services (enable only what you need)
//! - OEM extension support (also under feature flags)
//! - Patch helpers for vendor quirks that deviate from the Redfish CSDL
//!
//! Relationship to other crates
//! - Depends on `nv-redfish-core` for transport-agnostic traits (`Bmc`) and
//!   foundational types (`ODataId`, navigation properties, actions).
//! - Uses code generated by the CSDL compiler (included via the internal
//!   `schema` module) and re-exports ergonomic wrappers where applicable.
//! - The set of compiled schemas is controlled by `features.toml` to include
//!   only what is required by enabled features — keeping the build as
//!   lightweight as possible.
//!
//! Features
//! - Service feature flags such as `accounts`, `session-service`,
//!   `update-service`, and others enable typed wrappers for specific Redfish
//!   services and resources.
//! - OEM-specific feature flags enable vendor extensions when needed.
//!
//! Status
//! - The crate exposes typed wrappers for a growing subset of standard Redfish
//!   services and resources, plus selected OEM extensions.
//! - Additional services and OEM extensions continue to be added over time.
//!

// Recursion limit still needed in this crate because otherwise doc
// generation failed...
#![recursion_limit = "256"]
#![deny(
    clippy::all,
    clippy::pedantic,
    clippy::nursery,
    clippy::suspicious,
    clippy::complexity,
    clippy::perf
)]
#![deny(
    clippy::absolute_paths,
    clippy::todo,
    clippy::unimplemented,
    clippy::tests_outside_test_module,
    clippy::panic,
    clippy::unwrap_used,
    clippy::unwrap_in_result,
    clippy::unused_trait_names,
    clippy::print_stdout,
    clippy::print_stderr
)]
#![deny(missing_docs)]
#![allow(clippy::doc_markdown)]

/// Errors defined by the crate.
pub mod error;

/// Service Root implementation.
pub mod service_root;

/// Redfish resource common functions.
pub mod resource;

/// Hardware identifier (Manufacturer + Model + Part Number + Serial
/// Number).
pub mod hardware_id;

/// MAC addresses returned by the crate.
pub mod mac_address;

/// Accounts Service.
#[cfg(feature = "accounts")]
pub mod account;
/// Chassis.
#[cfg(feature = "chassis")]
pub mod chassis;
/// Computer System.
#[cfg(feature = "computer-systems")]
pub mod computer_system;
/// Manager.
#[cfg(feature = "managers")]
pub mod manager;
/// Update Service.
#[cfg(feature = "update-service")]
pub mod update_service;

#[cfg(feature = "assembly")]
pub mod assembly;
/// Ethernet interfaces.
#[cfg(feature = "ethernet-interfaces")]
pub mod ethernet_interface;
/// Event Service.
#[cfg(feature = "event-service")]
pub mod event_service;
/// Host interfaces.
#[cfg(feature = "host-interfaces")]
pub mod host_interface;
/// Log Service.
#[cfg(feature = "log-services")]
pub mod log_service;
#[cfg(feature = "network-device-functions")]
pub mod network_device_function;
/// `PCIe` devices.
#[cfg(feature = "pcie-devices")]
pub mod pcie_device;
/// Metrics and sensor abstraction.
#[cfg(feature = "sensors")]
pub mod sensor;
/// Session Service.
#[cfg(feature = "session-service")]
pub mod session_service;
/// Telemetry Service.
#[cfg(feature = "telemetry-service")]
pub mod telemetry_service;

/// Individual OEM extensions support.
#[cfg(feature = "oem")]
pub mod oem;

mod compiled_schema;

#[cfg(feature = "patch")]
pub(crate) mod patch_support;

/// Generic lightweight Redfish entity link.
#[cfg(feature = "impl-entity-link")]
pub mod entity_link;

/// Redfish protocol features.
pub(crate) mod protocol_features;

/// Bmc wrapper used in nv-redfish.
pub(crate) mod bmc;

/// BMC quirks support.
pub(crate) mod bmc_quirks;

#[doc(inline)]
pub use nv_redfish_core as core;

#[cfg(feature = "bmc-http")]
#[doc(inline)]
pub use nv_redfish_bmc_http as bmc_http;

#[doc(inline)]
pub use compiled_schema::redfish as schema;

#[doc(inline)]
pub use error::Error;
#[doc(inline)]
pub use nv_redfish_core::Bmc;
#[doc(inline)]
pub use protocol_features::ProtocolFeatures;
#[doc(inline)]
pub use resource::Resource;
#[doc(inline)]
pub use service_root::ServiceRoot;

#[doc(inline)]
#[cfg(feature = "resource-status")]
pub use resource::ResourceProvidesStatus;

#[cfg(feature = "resource-status")]
pub(crate) use crate::schema::resource::Status as ResourceStatusSchema;

pub(crate) use crate::schema::resource::Resource as ResourceSchema;
pub(crate) use bmc::NvBmc;