Skip to main content

Layer

Struct Layer 

Source
pub struct Layer {
    pub base_url: Option<String>,
    pub model: Option<String>,
    pub tool_mode: Option<ToolMode>,
    pub approvals: Option<Approvals>,
    pub auto_compact: Option<bool>,
    pub compact_percent: Option<u8>,
    pub subagents: Option<bool>,
    pub instructions: Option<String>,
    pub env: Option<EnvKind>,
    pub image: Option<String>,
    pub plugins: Option<BTreeMap<String, bool>>,
}
Expand description

One level’s own settings; None means “inherit”.

Fields§

§base_url: Option<String>§model: Option<String>§tool_mode: Option<ToolMode>§approvals: Option<Approvals>§auto_compact: Option<bool>§compact_percent: Option<u8>

Compact when a request passes this percentage of the context window (10..=95).

§subagents: Option<bool>

Offer the delegate tool.

§instructions: Option<String>

Appended to the system prompt after the less specific levels’ instructions.

§env: Option<EnvKind>§image: Option<String>

The container image (workspace only). None: the folder’s devcontainer.json if it has one, else the global default image.

§plugins: Option<BTreeMap<String, bool>>

Plugins turned on (true) or off (false) at this level, by plugin id; plugins not named inherit (on by default). Every level has it; it changes through its own message (SetPluginEnabled), not the settings form.

Implementations§

Source§

impl Layer

Source

pub fn has(&self, field: Field) -> bool

Is field set at this level?

Source

pub fn reset(&mut self, field: Field)

Forget field here (inherit it again).

Source

pub fn is_empty(&self) -> bool

Source

pub fn validated(self, level: Level) -> Result<Layer, String>

Check an untrusted layer for level: trims text, turns blank text into None, clamps the threshold, and refuses settings that don’t exist at that level, values that are too long, and images that aren’t plain references.

Trait Implementations§

Source§

impl Clone for Layer

Source§

fn clone(&self) -> Layer

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 Layer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Layer

Source§

fn default() -> Layer

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Layer

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Layer, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Layer

Source§

impl PartialEq for Layer

Source§

fn eq(&self, other: &Layer) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Layer

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Layer

Auto Trait Implementations§

§

impl Forget for Layer

§

impl Freeze for Layer

§

impl Move for Layer

§

impl RefUnwindSafe for Layer

§

impl Send for Layer

§

impl Sync for Layer

§

impl Unpin for Layer

§

impl UnsafeUnpin for Layer

§

impl UnwindSafe for Layer

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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.