pub struct GetBuilder<'a> { /* private fields */ }Expand description
Fluent query builder for BidsLayout::get().
Provides a chainable API for filtering BIDS files by entity values,
regex patterns, existence checks, and scope. Execute the query with
collect() (for BidsFile objects),
return_paths() (for PathBufs), or
return_unique() (for unique entity values).
§Examples
// Basic entity filters
let files = layout.get()
.suffix("eeg")
.extension(".edf")
.subject("01")
.collect().unwrap();
// Multi-value and regex filters
let files = layout.get()
.filter_any("subject", &["01", "02", "03"])
.filter_regex("suffix", "(bold|sbref)")
.collect().unwrap();
// Existence checks
let files = layout.get()
.query_any("session") // must have a session
.query_none("recording") // must NOT have a recording
.collect().unwrap();
// Get unique entity values
let tasks = layout.get()
.suffix("bold")
.return_unique("task").unwrap();Implementations§
Source§impl<'a> GetBuilder<'a>
impl<'a> GetBuilder<'a>
pub fn subject(self, v: &str) -> Self
pub fn session(self, v: &str) -> Self
pub fn task(self, v: &str) -> Self
pub fn run(self, v: &str) -> Self
pub fn datatype(self, v: &str) -> Self
pub fn acquisition(self, v: &str) -> Self
pub fn recording(self, v: &str) -> Self
pub fn space(self, v: &str) -> Self
pub fn suffix(self, v: &str) -> Self
pub fn extension(self, value: &str) -> Self
Sourcepub fn scope(self, scope: &str) -> Self
pub fn scope(self, scope: &str) -> Self
Set scope: “all”, “raw”, “derivatives”, “self”, or a pipeline name.
Sourcepub fn invalid_filters(self, mode: InvalidFilters) -> Self
pub fn invalid_filters(self, mode: InvalidFilters) -> Self
Set invalid filter handling.
Sourcepub fn filter_any(self, entity: &str, values: &[&str]) -> Self
pub fn filter_any(self, entity: &str, values: &[&str]) -> Self
Filter by entity with multiple allowed values.
Sourcepub fn filter_regex(self, entity: &str, pattern: &str) -> Self
pub fn filter_regex(self, entity: &str, pattern: &str) -> Self
Filter by entity with regex.
Sourcepub fn query_none(self, entity: &str) -> Self
pub fn query_none(self, entity: &str) -> Self
Require entity to NOT exist.
pub fn return_filenames(self) -> Self
pub fn return_ids(self, target: &str) -> Self
pub fn return_dirs(self, target: &str) -> Self
Sourcepub fn return_paths(self) -> Result<Vec<PathBuf>>
pub fn return_paths(self) -> Result<Vec<PathBuf>>
Execute query, returning file paths.
Sourcepub fn return_unique(self, target: &str) -> Result<Vec<String>>
pub fn return_unique(self, target: &str) -> Result<Vec<String>>
Execute query, returning unique values for a target entity.
Auto Trait Implementations§
impl<'a> Freeze for GetBuilder<'a>
impl<'a> !RefUnwindSafe for GetBuilder<'a>
impl<'a> !Send for GetBuilder<'a>
impl<'a> !Sync for GetBuilder<'a>
impl<'a> Unpin for GetBuilder<'a>
impl<'a> UnsafeUnpin for GetBuilder<'a>
impl<'a> !UnwindSafe for GetBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more