Skip to content
Open
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Upcoming Release

- [[#91]](https://github.com/rust-vmm/seccompiler/pull/91): Actually make
`JsonFrontendError` type publicly accessible, this type is referred to in a
public variant of `Error` but was not accessible outside the crate.

# v0.5.0

## Added
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ keywords = ["seccomp", "jail", "sandbox"]
license = "Apache-2.0 OR BSD-3-Clause"
edition = "2021"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
json = ["serde", "serde_json"]

Expand Down
1 change: 1 addition & 0 deletions src/frontend/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use serde::{Deserialize, Deserializer};
type Result<T> = result::Result<T, Error>;

/// Error compiling JSON into IR.
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
#[derive(Debug)]
pub enum Error {
/// Backend error creating the `SeccompFilter` IR.
Expand Down
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
//! [`SeccompRule`]: struct.SeccompRule.html
//! [`SeccompAction`]: enum.SeccompAction.html

#![cfg_attr(docsrs, feature(doc_cfg))]

mod backend;
#[cfg(feature = "json")]
mod frontend;
Expand All @@ -200,8 +202,11 @@ use std::collections::HashMap;
use std::fmt::{Display, Formatter};
use std::io;

#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
#[cfg(feature = "json")]
pub use frontend::json::Error as JsonFrontendError;
#[cfg(feature = "json")]
use frontend::json::{Error as JsonFrontendError, JsonCompiler};
use frontend::json::JsonCompiler;

// Re-export the IR public types.
pub use backend::{
Expand Down Expand Up @@ -238,6 +243,7 @@ pub enum Error {
/// of the thread that caused the failure.
ThreadSync(libc::c_long),
/// Json Frontend Error.
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
#[cfg(feature = "json")]
JsonFrontend(JsonFrontendError),
}
Expand Down Expand Up @@ -295,6 +301,7 @@ impl From<BackendError> for Error {
Self::Backend(value)
}
}
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
#[cfg(feature = "json")]
impl From<JsonFrontendError> for Error {
fn from(value: JsonFrontendError) -> Self {
Expand Down