Skip to main content

SessionFs

Struct SessionFs 

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

Files reached through a persistent session: the container counterpart of LocalFs at a round trip of a few milliseconds, instead of 2-5 docker exec per operation (a container edit cost about 300 ms). Content crosses through a heredoc read by the read builtin, so no byte is interpreted on the way. Falls back to ContainerFs (or LocalFs for a local launcher) when no session can start. Error messages match ContainerFs.

Implementations§

Source§

impl SessionFs

Source

pub fn container(container_id: String, workdir: PathBuf) -> Self

Source

pub fn local(root: PathBuf) -> Self

A session on this machine: for tests, and for executors without a container.

Trait Implementations§

Source§

impl Fs for SessionFs

Source§

fn read(&self, path: &Path) -> Result<String, String>

Source§

fn write(&self, path: &Path, content: &str) -> Result<(), String>

Source§

fn canonicalize(&self, path: &Path) -> Result<PathBuf, String>

Resolve symlinks and ... Used for the workspace-escape check, so it must answer for the filesystem the operation will really touch.
Source§

fn is_local(&self) -> bool

Whether paths name files on this machine, so tools may read them in-process.

Auto Trait Implementations§

§

impl !Freeze for SessionFs

§

impl !RefUnwindSafe for SessionFs

§

impl !UnwindSafe for SessionFs

§

impl Forget for SessionFs

§

impl Move for SessionFs

§

impl Send for SessionFs
where RawVecInner: Send, Arc<dyn Fn() -> Result<Profile, String> + Sync + Send>: Send, Mutex<Option<Session>>: Send, Mutex<Option<UserSession>>: Send, BoxRaw<dyn Shell>: Send, BoxRaw<dyn Fs>: Send,

§

impl Sync for SessionFs
where RawVecInner: Sync, Arc<dyn Fn() -> Result<Profile, String> + Sync + Send>: Sync, Mutex<Option<Session>>: Sync, Mutex<Option<UserSession>>: Sync, BoxRaw<dyn Shell>: Sync, BoxRaw<dyn Fs>: Sync,

§

impl Unpin for SessionFs
where *const u8 is !null: Unpin, Arc<dyn Fn() -> Result<Profile, String> + Sync + Send>: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin, I32NotAllOnes: Unpin, *mut Counter<Channel<Vec<u8>>>: Unpin, *mut Counter<Channel<Vec<u8>>>: Unpin, *mut Counter<Channel<Vec<u8>>>: Unpin, Box<dyn Shell>: Unpin, Box<dyn Fs>: Unpin,

§

impl UnsafeUnpin for SessionFs
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<PathBuf>: UnsafeUnpin, *const ArcInner<dyn Fn() -> Result<Profile, String> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn() -> Result<Profile, String> + Sync + Send>>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, I32NotAllOnes: UnsafeUnpin, *mut Counter<Channel<Vec<u8>>>: UnsafeUnpin, *mut Counter<Channel<Vec<u8>>>: UnsafeUnpin, *mut Counter<Channel<Vec<u8>>>: UnsafeUnpin, *const dyn Shell is !null: UnsafeUnpin, PhantomData<dyn Shell>: UnsafeUnpin, *const dyn Fs is !null: UnsafeUnpin, PhantomData<dyn Fs>: UnsafeUnpin,

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