pub struct FilterControl(/* private fields */);Expand description
runtime control over the indexing filter.
the filter has two orthogonal axes:
mode controls discovery:
FilterMode::Filter: only indexes repos whose firehose commits touch a collection matching a configuredsignal. explicit [ReposControl::track] always works regardless.FilterMode::Full: indexes the entire network.signalsare ignored for discovery butcollectionsandexcludesstill apply.
sets are each independently configurable:
signals: NSID patterns that trigger auto-discovery infiltermode (e.g.app.bsky.feed.post,app.bsky.graph.*)collections: NSID patterns that filter which records are stored. empty means store all.excludes: DIDs that are always skipped regardless of mode.
NSID patterns support an optional .* suffix to match an entire namespace.
all mutations are persisted to the database and take effect immediately.
Implementations§
Source§impl FilterControl
impl FilterControl
Sourcepub async fn get(&self) -> Result<FilterSnapshot>
pub async fn get(&self) -> Result<FilterSnapshot>
return the current filter configuration from the database.
Sourcepub fn set_mode(&self, mode: FilterMode) -> FilterPatch
pub fn set_mode(&self, mode: FilterMode) -> FilterPatch
set the indexing mode. see FilterControl for mode semantics.
Sourcepub fn set_signals(
&self,
signals: impl IntoIterator<Item = impl Into<String>>,
) -> FilterPatch
pub fn set_signals( &self, signals: impl IntoIterator<Item = impl Into<String>>, ) -> FilterPatch
replace the entire signals set. existing signals are removed.
Sourcepub fn append_signals(
&self,
signals: impl IntoIterator<Item = impl Into<String>>,
) -> FilterPatch
pub fn append_signals( &self, signals: impl IntoIterator<Item = impl Into<String>>, ) -> FilterPatch
add multiple signals without disturbing existing ones.
Sourcepub fn add_signal(&self, signal: impl Into<String>) -> FilterPatch
pub fn add_signal(&self, signal: impl Into<String>) -> FilterPatch
add a single signal. no-op if already present.
Sourcepub fn remove_signal(&self, signal: impl Into<String>) -> FilterPatch
pub fn remove_signal(&self, signal: impl Into<String>) -> FilterPatch
remove a single signal. no-op if not present.
Sourcepub fn set_collections(
&self,
collections: impl IntoIterator<Item = impl Into<String>>,
) -> FilterPatch
pub fn set_collections( &self, collections: impl IntoIterator<Item = impl Into<String>>, ) -> FilterPatch
replace the entire collections set. pass an empty iterator to store all collections.
Sourcepub fn append_collections(
&self,
collections: impl IntoIterator<Item = impl Into<String>>,
) -> FilterPatch
pub fn append_collections( &self, collections: impl IntoIterator<Item = impl Into<String>>, ) -> FilterPatch
add multiple collections without disturbing existing ones.
Sourcepub fn add_collection(&self, collection: impl Into<String>) -> FilterPatch
pub fn add_collection(&self, collection: impl Into<String>) -> FilterPatch
add a single collection filter. no-op if already present.
Sourcepub fn remove_collection(&self, collection: impl Into<String>) -> FilterPatch
pub fn remove_collection(&self, collection: impl Into<String>) -> FilterPatch
remove a single collection filter. no-op if not present.
Sourcepub fn set_excludes(
&self,
excludes: impl IntoIterator<Item = impl Into<String>>,
) -> FilterPatch
pub fn set_excludes( &self, excludes: impl IntoIterator<Item = impl Into<String>>, ) -> FilterPatch
replace the entire excludes set.
Sourcepub fn append_excludes(
&self,
excludes: impl IntoIterator<Item = impl Into<String>>,
) -> FilterPatch
pub fn append_excludes( &self, excludes: impl IntoIterator<Item = impl Into<String>>, ) -> FilterPatch
add multiple DIDs to the excludes set without disturbing existing ones.
Sourcepub fn add_exclude(&self, did: impl Into<String>) -> FilterPatch
pub fn add_exclude(&self, did: impl Into<String>) -> FilterPatch
add a single DID to the excludes set. no-op if already excluded.
Sourcepub fn remove_exclude(&self, did: impl Into<String>) -> FilterPatch
pub fn remove_exclude(&self, did: impl Into<String>) -> FilterPatch
remove a single DID from the excludes set. no-op if not present.
Trait Implementations§
Source§impl Clone for FilterControl
impl Clone for FilterControl
Source§fn clone(&self) -> FilterControl
fn clone(&self) -> FilterControl
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FilterControl
impl !RefUnwindSafe for FilterControl
impl Send for FilterControl
impl Sync for FilterControl
impl Unpin for FilterControl
impl !UnwindSafe for FilterControl
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more