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

Make RulesetRule public, fix intra-doc links #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub use crate::errors::*;
pub use crate::flags::ScanFlags;
use crate::initialize::InitializationToken;
pub use crate::matches::Match;
pub use crate::rules::{Metadata, MetadataValue, Rule, Rules};
pub use crate::rules::{Metadata, MetadataValue, Rule, Rules, RulesetRule};
pub use crate::scanner::Scanner;
pub use crate::string::YrString;
pub use internals::{
Expand Down
8 changes: 6 additions & 2 deletions src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ impl Rules {
/// # Safety
///
/// The provided pointer must be valid, and be acquired from the Yara
/// library, either through [`yr_compiler_get_rules`], [`yr_rules_load`] or
/// [`yr_rules_load_stream`].
/// library, either through [`yr_compiler_get_rules`](yara_sys::yr_compiler_get_rules),
/// [`yr_rules_load`](yara_sys::yr_rules_load) or
/// [`yr_rules_load_stream`](yara_sys::yr_rules_load_stream).
pub unsafe fn unsafe_try_from(rules: *mut yara_sys::YR_RULES) -> Result<Self, YaraError> {
let token = InitializationToken::new()?;

Expand Down Expand Up @@ -322,7 +323,10 @@ impl Drop for Rules {

/// A rule contained in a ruleset.

#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RulesetRule<'r> {
#[cfg_attr(feature = "serde", serde(skip))]
pub(crate) inner: *mut yara_sys::YR_RULE,
/// Name of the rule.
pub identifier: &'r str,
Expand Down
Loading