pub struct Context {
pub root: PathBuf,
pub is_project: bool,
}Fields§
§root: PathBufRoot directory for libtorch storage. Either a project root or ~/.flodl.
is_project: boolWhether we are operating inside a detected project.
Implementations§
Source§impl Context
impl Context
Sourcepub fn resolve() -> Self
pub fn resolve() -> Self
Auto-detect: walk up from cwd looking for a flodl project, fall back
to ~/.flodl/.
Sourcepub fn global() -> Self
pub fn global() -> Self
The global root, whether or not cwd sits inside a project:
$FLODL_HOME, else ~/.flodl.
Context::resolve prefers a project root, which is right for a
developer managing their checkout’s libtorch and wrong for a box
that is only consuming artifacts: a dial-in worker’s project
root is frequently a read-only shared mount, so its acquisitions
(libtorch, the fetched source tree) belong under the root fdl
manages on that one box. The two are named apart on purpose.
Sourcepub fn libtorch_dir(&self) -> PathBuf
pub fn libtorch_dir(&self) -> PathBuf
The libtorch directory under this root.
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more