Skip to main content

Envs

Struct Envs 

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

The package managers found on this machine, the per-workspace state they keep, and what the user decided per workspace.

Implementations§

Source§

impl Envs

Source

pub fn detect(data_dir: Option<&Path>) -> Self

Detect what this machine has. data_dir holds caches, installed packages and the per-workspace answers; without it only the package managers’ CLIs are made to work inside the sandbox.

Source

pub fn new(data_dir: Option<&Path>, found: Found, mode: ProjectMode) -> Self

Use exactly what found lists.

Source

pub fn none() -> Self

No package managers (tests, or a machine without any).

Source

pub fn register(&mut self, id: &str, provider: Box<dyn EnvProvider>)

Add a provider (after byob’s own), switched on and off in chats by id like theirs (an EnvPlan::providers whose off names it leaves it out).

Source

pub fn installer(&self) -> Option<&'static str>

The package manager install_packages uses here, if any.

Source

pub fn containers(&self) -> Option<&Containers>

Docker or Podman, if workspaces can run their commands in a container.

Source

pub fn prompt(&self) -> Option<String>

A short paragraph for the system prompt.

Source

pub fn system(&self) -> Option<&SystemInstaller>

Homebrew or winget, if install_system_packages is offered.

Trait Implementations§

Source§

impl Debug for Envs

Source§

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

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

impl Default for Envs

Source§

fn default() -> Self

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

impl EnvControl for Envs

Source§

fn describe(&self, ws: &Path, plan: &EnvPlan) -> WorkspaceEnv

The settings and state of workspace ws, whose settings say plan.
Source§

fn support(&self) -> EnvSupport

What this machine offers (Nix, a container runtime). Cheap.
Source§

fn check_containers(&self) -> Result<String, String>

Whether the container runtime answers; the error says what to do. May take seconds.
Source§

fn forget(&self, ws: &Path) -> Result<String, String>

Forget everything byob keeps for ws outside the folder: its answers, installed packages and container. The folder itself is never touched. May take seconds.
Source§

fn apply(&self, ws: &Path, action: &EnvAction) -> Result<String, String>

Change them; returns what happened, for the user.

Auto Trait Implementations§

§

impl !Freeze for Envs

§

impl !RefUnwindSafe for Envs

§

impl !UnwindSafe for Envs

§

impl Forget for Envs

§

impl Move for Envs

§

impl Send for Envs

§

impl Sync for Envs

§

impl Unpin for Envs

§

impl UnsafeUnpin for Envs

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> ErasedDestructor for T
where T: 'static,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.