Filter
- file format 6
- Rust SDK 1.0 preview
Selecting records by kind and by the start of their primary id. A filter matches each record on its own; it follows no relations.
On this page, Result<T> is std::result::Result<T, plxi_sdk::Error>.
Every public struct and enum with a public field or variant is marked #[non_exhaustive]: code outside the crate builds one through its constructors and matches an enum with a _ arm.
Structs
#[non_exhaustive]
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct Filter {
pub kinds: Option<Vec<String>>,
pub id_prefix: Option<String>,
}- Summary
Which records to keep. Every field that is set must match; an unset field matches everything, so
Filter::default()keeps every record.- Fields
kinds: Option<Vec<String>>Keep records whose kind (k) is in this list.id_prefix: Option<String>Keep records whose primary id (spec §5.3) starts with this prefix.
- Example
- Example 3: Filter and views
- Spec
- Spec §5.3
pub fn new() -> Filter- Summary
A filter that keeps every record.
- Parameters
- None.
- Returns
Filter- Example
- Example 3: Filter and views
- Spec
- Spec §5.3
pub fn with_kinds<I, S>(mut self, kinds: I) -> Filter
where
I: IntoIterator<Item = S>,
S: Into<String>,- Summary
Keep only these kinds.
- Parameters
kinds: I
- Returns
Filter- Example
- Example 3: Filter and views
- Spec
- Spec §5.3
pub fn with_id_prefix(mut self, prefix: impl Into<String>) -> Filter- Summary
Keep only records whose primary id starts with
prefix.- Parameters
prefix: impl Into<String>
- Returns
Filter- Example
- Example 3: Filter and views
- Spec
- Spec §5.3
pub fn matches(&self, record: &Record) -> bool- Summary
Whether
recordpasses the filter.- Parameters
record: &Record
- Returns
bool- Example
- Example 3: Filter and views
- Spec
- Spec §5.3
© 2020-2026 Cintile Inc. All Rights Reserved.
Anyone may implement this format. Copying or republishing the text of this specification requires permission from Cintile Inc.