Skip to main content

ConfigService

Struct ConfigService 

Source
pub struct ConfigService { /* private fields */ }
Expand description

Holds the live config and applies mutations at runtime: each change is validated against provider capabilities and persisted. Secrets go to the secret store; the config only ever references them by key.

Implementations§

Source§

impl ConfigService

Source

pub fn new( store: Arc<dyn ConfigStore>, secrets: Arc<dyn SecretStore>, registry: Arc<ProviderRegistry>, ) -> Self

Source

pub async fn load(&self) -> Result<()>

Source

pub fn snapshot(&self) -> ForgetopConfig

Source

pub fn subscribe_data_changed(&self) -> Receiver<u64>

Fires whenever connections or section bindings change, from anywhere in the process. A watch channel coalesces bursts, so the multi-step setup flow (add connection, then bind each section) settles into one reload rather than four.

Source

pub async fn add_or_update_connection( &self, connection: Connection, secret: Option<String>, ) -> Result<()>

Source

pub async fn remove_connection(&self, connection_id: &str) -> Result<()>

Source

pub async fn bind_pull_requests(&self, connection_id: &str) -> Result<()>

Source

pub async fn bind_work_items(&self, connection_id: &str) -> Result<()>

Source

pub async fn unbind_pull_requests(&self, connection_id: &str) -> Result<()>

Removes a single connection from the PR section (leaves others bound).

Source

pub async fn unbind_work_items(&self, connection_id: &str) -> Result<()>

Removes a single connection from the work-item section (leaves others bound).

Source

pub async fn unbind_pipelines(&self, connection_id: &str) -> Result<()>

Drops a connection’s pipeline subscription entirely (unbinds it from the section).

Source

pub async fn set_pull_request_connections( &self, connection_ids: Vec<String>, ) -> Result<()>

Replaces the PR section’s connections with an explicit set (multi-bind).

Source

pub async fn set_work_item_connections( &self, connection_ids: Vec<String>, ) -> Result<()>

Source

pub async fn unbind_section(&self, section: Section) -> Result<()>

Source

pub async fn subscribe_pipeline( &self, connection_id: &str, definition_id: &str, ) -> Result<()>

Source

pub async fn set_pipeline_auto_discover( &self, connection_id: &str, auto_discover_all: bool, ) -> Result<()>

Source

pub async fn unsubscribe_pipeline( &self, connection_id: &str, definition_id: &str, ) -> Result<()>

Source

pub async fn remove_pipeline_connection( &self, connection_id: &str, ) -> Result<()>

Source

pub async fn set_repo_scope( &self, connection_id: &str, scope: Option<Vec<String>>, ) -> Result<()>

Replaces a connection’s repository scope. Some(vec![]) is a real, respected state — the user chose no repositories — and must not be confused with None, which means the scope was never established and the legacy single repository still applies.

Source

pub fn repo_scope(&self, connection_id: &str) -> Option<Vec<String>>

A connection’s stored scope, exactly as stored (including the None / Some([]) distinction) — the picker needs to tell “never chosen” from “chose none”.

Source

pub async fn set_theme(&self, theme: Option<String>) -> Result<()>

Source

pub async fn set_hidden_sections(&self, hidden: Vec<Section>) -> Result<()>

Source

pub async fn set_preview_hidden(&self, hidden: Vec<Section>) -> Result<()>

Source

pub async fn set_hidden_work_item_states( &self, hidden: Vec<String>, ) -> Result<()>

Source

pub async fn set_dismissed_launchpad_items( &self, dismissed: Vec<String>, ) -> Result<()>

Source

pub async fn set_notifications(&self, prefs: NotificationPrefs) -> Result<()>

Source

pub async fn set_views( &self, section: Section, views: Vec<SavedView>, ) -> Result<()>

Persists the saved views for a section.

Source

pub async fn set_sort( &self, section: Section, sort: Option<SortPref>, ) -> Result<()>

Persists the sort for a section (None restores provider order).

Source

pub async fn set_pipeline_group(&self, group: Option<String>) -> Result<()>

Persists how the Pipelines list is grouped (None restores the default).

Source

pub async fn set_pipeline_definitions( &self, connection_id: &str, definition_ids: Vec<String>, ) -> Result<()>

Replaces a connection’s tracked pipeline definitions with an explicit set (turns off auto-discovery). An empty list tracks nothing.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.