pub struct Session { /* private fields */ }Expand description
Relative file reads and directory listings use the selected Artifact’s own scope, not the workspace or the rest of the review’s scope. A viewer cannot choose its own scope.
Implementations§
Source§impl Session
impl Session
pub fn open(repo: &Path, artifact: &ArtifactName) -> Result<Self, String>
pub fn scope(&self) -> Scope
pub fn workspace(&self) -> &Path
pub fn checkout(&self) -> &Identity
Sourcepub fn check_checkout(&self) -> Result<(), String>
pub fn check_checkout(&self) -> Result<(), String>
The same path may later hold different branch contents and must not be reused.
Sourcepub fn check_scope(&self) -> Result<(), String>
pub fn check_scope(&self) -> Result<(), String>
An already-open viewer’s scope cannot authorize access after a declaration changes.
pub fn entry(&self) -> &ViewerEntry
pub fn context<'a>(&'a self, review: Option<&'a Review>) -> Context<'a>
Sourcepub async fn pointing(
&self,
state: &Path,
review: &Review,
text: &str,
) -> Result<Draft, String>
pub async fn pointing( &self, state: &Path, review: &Review, text: &str, ) -> Result<Draft, String>
Append a Point to the host-selected review; the store rechecks its claim atomically.
pub fn read_text(&self, path: &InputPath) -> Result<String, String>
Sourcepub fn files(&self, path: &InputPath) -> Result<Vec<FileEntry>, String>
pub fn files(&self, path: &InputPath) -> Result<Vec<FileEntry>, String>
Read one directory at a time. Never list non-owned siblings of a file Artifact or directories outside an aspect’s selection.
pub fn declarations(&self) -> Result<Structure, String>
Trait Implementations§
Auto Trait Implementations§
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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