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, tool: &ToolFqn, ) -> 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 Sessionwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<OsString>: Freeze,
PhantomData<LogicalPath>: Freeze,
*const LeafNode<ChildPrefix, ArtifactName> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(ChildPrefix, ArtifactName)>>: Freeze,
*const LeafNode<ArtifactName, SetValZST> is !null: Freeze,
PhantomData<Box<(ArtifactName, SetValZST)>>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<ToolFqn, ToolSession> is !null: Freeze,
PhantomData<Box<(ToolFqn, ToolSession)>>: Freeze,
*const LeafNode<ToolFqn, AgentTool> is !null: Freeze,
PhantomData<Box<(ToolFqn, AgentTool)>>: Freeze,
*const LeafNode<ToolFqn, HumanTool> is !null: Freeze,
PhantomData<Box<(ToolFqn, HumanTool)>>: Freeze,
PhantomData<Argument>: Freeze,
PhantomData<GlobSetMatchStrategy>: Freeze,
PhantomData<Glob>: Freeze,
*const ArcInner<Pool<Vec<usize>>> is !null: Freeze,
PhantomData<ArcInner<Pool<Vec<usize>>>>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
impl Move for Session
impl RefUnwindSafe for Sessionwhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + Sync + RefUnwindSafe + Send + UnwindSafe>>: RefUnwindSafe,
Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + RefUnwindSafe + Send + UnwindSafe>>: RefUnwindSafe,
Pool<Vec<usize>, fn() -> Vec<usize>>: RefUnwindSafe,
impl Send for Sessionwhere
RawVecInner: Send,
NodeRef<Owned, ChildPrefix, ArtifactName, LeafOrInternal>: Send,
BoxRaw<(ChildPrefix, ArtifactName)>: Send,
NodeRef<Owned, ArtifactName, SetValZST, LeafOrInternal>: Send,
BoxRaw<(ArtifactName, SetValZST)>: Send,
NodeRef<Owned, ToolFqn, ToolSession, LeafOrInternal>: Send,
BoxRaw<(ToolFqn, ToolSession)>: Send,
NodeRef<Owned, ToolFqn, AgentTool, LeafOrInternal>: Send,
BoxRaw<(ToolFqn, AgentTool)>: Send,
NodeRef<Owned, ToolFqn, HumanTool, LeafOrInternal>: Send,
BoxRaw<(ToolFqn, HumanTool)>: Send,
RawTable<(Vec<u8>, Vec<usize>)>: Send,
Arc<dyn AcAutomaton>: Send,
RawTable<(Vec<u8>, Vec<(usize, Regex)>)>: Send,
Arc<RegexI>: Send,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + RefUnwindSafe + Send + UnwindSafe>>>: Send,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + RefUnwindSafe + Send + UnwindSafe>>>: Send,
Arc<Pool<Vec<usize>>>: Send,
Arc<str>: Send,
impl Sync for Sessionwhere
RawVecInner: Sync,
NodeRef<Owned, ChildPrefix, ArtifactName, LeafOrInternal>: Sync,
BoxRaw<(ChildPrefix, ArtifactName)>: Sync,
NodeRef<Owned, ArtifactName, SetValZST, LeafOrInternal>: Sync,
BoxRaw<(ArtifactName, SetValZST)>: Sync,
NodeRef<Owned, ToolFqn, ToolSession, LeafOrInternal>: Sync,
BoxRaw<(ToolFqn, ToolSession)>: Sync,
NodeRef<Owned, ToolFqn, AgentTool, LeafOrInternal>: Sync,
BoxRaw<(ToolFqn, AgentTool)>: Sync,
NodeRef<Owned, ToolFqn, HumanTool, LeafOrInternal>: Sync,
BoxRaw<(ToolFqn, HumanTool)>: Sync,
RawTable<(Vec<u8>, Vec<usize>)>: Sync,
Arc<dyn AcAutomaton>: Sync,
RawTable<(Vec<u8>, Vec<(usize, Regex)>)>: Sync,
Arc<RegexI>: Sync,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + RefUnwindSafe + Send + UnwindSafe>>>: Sync,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + RefUnwindSafe + Send + UnwindSafe>>>: Sync,
Arc<Pool<Vec<usize>>>: Sync,
Arc<str>: Sync,
impl Unpin for Sessionwhere
*const u8 is !null: Unpin,
*const LeafNode<ChildPrefix, ArtifactName> is !null: Unpin,
Box<(ChildPrefix, ArtifactName)>: Unpin,
*const LeafNode<ArtifactName, SetValZST> is !null: Unpin,
Box<(ArtifactName, SetValZST)>: Unpin,
*const LeafNode<ToolFqn, ToolSession> is !null: Unpin,
Box<(ToolFqn, ToolSession)>: Unpin,
*const LeafNode<ToolFqn, AgentTool> is !null: Unpin,
Box<(ToolFqn, AgentTool)>: Unpin,
*const LeafNode<ToolFqn, HumanTool> is !null: Unpin,
Box<(ToolFqn, HumanTool)>: Unpin,
Arc<dyn AcAutomaton>: Unpin,
Arc<RegexI>: Unpin,
Box<Pool<Cache, Box<dyn Fn() -> Cache + Sync + RefUnwindSafe + Send + UnwindSafe>>>: Unpin,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + RefUnwindSafe + Send + UnwindSafe>>>: Unpin,
Arc<Pool<Vec<usize>>>: Unpin,
Arc<str>: Unpin,
impl UnsafeUnpin for Sessionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<OsString>: UnsafeUnpin,
PhantomData<LogicalPath>: UnsafeUnpin,
*const LeafNode<ChildPrefix, ArtifactName> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(ChildPrefix, ArtifactName)>>: UnsafeUnpin,
*const LeafNode<ArtifactName, SetValZST> is !null: UnsafeUnpin,
PhantomData<Box<(ArtifactName, SetValZST)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<ToolFqn, ToolSession> is !null: UnsafeUnpin,
PhantomData<Box<(ToolFqn, ToolSession)>>: UnsafeUnpin,
*const LeafNode<ToolFqn, AgentTool> is !null: UnsafeUnpin,
PhantomData<Box<(ToolFqn, AgentTool)>>: UnsafeUnpin,
*const LeafNode<ToolFqn, HumanTool> is !null: UnsafeUnpin,
PhantomData<Box<(ToolFqn, HumanTool)>>: UnsafeUnpin,
PhantomData<Argument>: UnsafeUnpin,
PhantomData<GlobSetMatchStrategy>: UnsafeUnpin,
PhantomData<Glob>: UnsafeUnpin,
*const ArcInner<Pool<Vec<usize>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Pool<Vec<usize>>>>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
impl UnwindSafe for Sessionwhere
RawVecInner: UnwindSafe,
BTreeMap<ChildPrefix, ArtifactName>: UnwindSafe,
BTreeMap<ArtifactName, SetValZST>: UnwindSafe,
BTreeMap<ToolFqn, ToolSession>: UnwindSafe,
BTreeMap<ToolFqn, AgentTool>: UnwindSafe,
BTreeMap<ToolFqn, HumanTool>: UnwindSafe,
HashMap<Vec<u8>, Vec<usize>, BuildHasherDefault<Hasher>>: UnwindSafe,
Arc<dyn AcAutomaton>: UnwindSafe,
HashMap<Vec<u8>, Vec<(usize, Regex)>, BuildHasherDefault<Hasher>>: UnwindSafe,
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + RefUnwindSafe + Send + UnwindSafe>>>: UnwindSafe,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + Sync + RefUnwindSafe + Send + UnwindSafe>>>: UnwindSafe,
Arc<Pool<Vec<usize>>>: UnwindSafe,
Arc<str>: UnwindSafe,
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