pub struct TealResolver { /* private fields */ }Expand description
Resolves require("a.b") to a/b.tl, a/b/init.tl, or a/b.d.tl under a
sandboxed root, type-checking and generating on the fly.
Implementations§
Source§impl TealResolver
impl TealResolver
Sourcepub fn new(root: impl Into<PathBuf>) -> Result<Self, InitError>
pub fn new(root: impl Into<PathBuf>) -> Result<Self, InitError>
Strict sandbox (no symlinks out of root).
Sourcepub fn new_symlink_aware(root: impl Into<PathBuf>) -> Result<Self, InitError>
pub fn new_symlink_aware(root: impl Into<PathBuf>) -> Result<Self, InitError>
Sandbox that follows symlinks directly under root (linked package roots).
Sourcepub fn with_sandbox(
sandbox: impl SandboxedFs + 'static,
root: Option<PathBuf>,
) -> Self
pub fn with_sandbox( sandbox: impl SandboxedFs + 'static, root: Option<PathBuf>, ) -> Self
Custom sandbox. Pass root so the Teal checker can also see the tree when
resolving requires inside .tl files (it searches package.path).
pub fn with_module_separator(self, sep: char) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TealResolver
impl !RefUnwindSafe for TealResolver
impl !UnwindSafe for TealResolver
impl Send for TealResolver
impl Sync for TealResolver
impl Unpin for TealResolver
impl UnsafeUnpin for TealResolver
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more