Skip to main content

TargetPlan

Struct TargetPlan 

Source
pub struct TargetPlan {
Show 14 fields pub clients: Vec<&'static str>, pub scope: Scope, pub project_id: Option<String>, pub project: Option<PathBuf>, pub kind: EntryKind, pub file: PathBuf, pub container: Vec<String>, pub pointer: String, pub before: Option<Vec<u8>>, pub after: Option<Vec<u8>>, pub entries: Vec<EntryPlan>, pub problem: Option<CoreError>, pub warnings: Vec<CoreError>, pub read_only: Option<ReadOnlyKind>, /* private fields */
}
Expand description

One native file and container.

Fields§

§clients: Vec<&'static str>

Every client whose entries go to this container, in table order.

§scope: Scope§project_id: Option<String>

The project of a project or project-local target.

§project: Option<PathBuf>

The project folder <P>, when known.

§kind: EntryKind

Server entries of a container, or members of a list (Claude Code disabledMcpServers).

§file: PathBuf§container: Vec<String>

Container keys in the file.

§pointer: String§before: Option<Vec<u8>>

The file bytes planned against; None when it does not exist.

§after: Option<Vec<u8>>

The bytes to write; None when the file stays as it is.

§entries: Vec<EntryPlan>§problem: Option<CoreError>

The whole target is blocked (parse_error, unexpected_shape, trust_required).

§warnings: Vec<CoreError>§read_only: Option<ReadOnlyKind>

This account cannot write the file (or create it): what the write probe found while planning (SPEC 8.2 read_only_target). Entries that would write it are blocked; the target is listed all the same.

Implementations§

Source§

impl TargetPlan

Source

pub fn client(&self) -> &'static str

The client named in reports: the first one.

Source

pub fn counts(&self) -> OpCounts

Counts of planned write actions: create, update, remove, disable.

Source

pub fn has_work(&self) -> bool

Whether anything (file or ledger) would change.

Source

pub fn unresolved(&self) -> usize

Entries that need a decision that was not given.

Source

pub fn is_blocked(&self) -> bool

Whether some entry or the whole target is blocked.

Source

pub fn diff(&self) -> String

The change as a unified diff of the file text; empty when the file stays as it is. Values written by inline delivery are masked (SPEC 8.3).

Source

pub fn mask(&self, text: &str) -> String

text with every value to hide replaced, as written and as a JSON or TOML string escape: the inline values this plan writes become ********; the values an inline entry holds now that this plan does not write again (a rotation, a mode change, a removal) become ******** (before), so a changed value still shows as a change. Values shorter than four characters are left alone: masking them would garble the diff without hiding anything.

Source

pub fn snippet(&self, name: &str, value: &NativeValue) -> Option<String>

Entry name with native value value, alone under the innermost key of this target’s container, as the file format writes it ({"mcpServers": {...}}, [mcp_servers.x]), with TargetPlan::mask applied: the snippet the effective view and the drift resolver show. Outer container keys are left out (Claude Code’s per-project map is keyed by the folder path). None when the format cannot hold it.

Trait Implementations§

Source§

impl Clone for TargetPlan

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TargetPlan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for TargetPlan

§

impl Freeze for TargetPlan
where *const u8 is !null: Freeze, PhantomData<&'static str>: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, PhantomData<EntryPlan>: Freeze, PhantomData<CoreError>: Freeze, PhantomData<SecretValue>: Freeze, &'static str: Freeze, &'static [&'static str]: Freeze, PhantomData<DesiredEntry>: Freeze, PhantomData<DesiredMember>: Freeze, *const LeafNode<&'static str, bool> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(&'static str, bool)>>: Freeze,

§

impl Move for TargetPlan

§

impl RefUnwindSafe for TargetPlan

§

impl Send for TargetPlan
where RawVecInner: Send, &'static str: Send, &'static [&'static str]: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, NodeRef<Owned, &'static str, bool, LeafOrInternal>: Send, BoxRaw<(&'static str, bool)>: Send,

§

impl Sync for TargetPlan
where RawVecInner: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync, NodeRef<Owned, &'static str, bool, LeafOrInternal>: Sync, BoxRaw<(&'static str, bool)>: Sync,

§

impl Unpin for TargetPlan
where *const u8 is !null: Unpin, &'static str: Unpin, &'static [&'static str]: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, *const LeafNode<&'static str, bool> is !null: Unpin, Box<(&'static str, bool)>: Unpin,

§

impl UnsafeUnpin for TargetPlan

§

impl UnwindSafe for TargetPlan
where RawVecInner: UnwindSafe, &'static str: UnwindSafe, &'static [&'static str]: UnwindSafe, BTreeMap<String, String>: UnwindSafe, BTreeMap<&'static str, bool>: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more