pub struct WorktreeClient { /* private fields */ }Expand description
Scoped client for worktree operations (transport-agnostic).
Implementations§
Source§impl WorktreeClient
impl WorktreeClient
Sourcepub async fn call(&self, payload: Vec<u8>) -> Result<Vec<u8>>
pub async fn call(&self, payload: Vec<u8>) -> Result<Vec<u8>>
Send a raw request and return the raw response bytes.
Sourcepub async fn call_streaming(
&self,
payload: Vec<u8>,
ephemeral_pubkey: [u8; 32],
) -> Result<Vec<u8>>
pub async fn call_streaming( &self, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Result<Vec<u8>>
Send a streaming request with ephemeral DH pubkey.
Sourcepub fn parse_scoped_response(
bytes: &[u8],
) -> Result<WorktreeClientResponseVariant>
pub fn parse_scoped_response( bytes: &[u8], ) -> Result<WorktreeClientResponseVariant>
Parse a scoped response from raw bytes.
Sourcepub async fn walk(&self, __request: &NpWalk) -> Result<RWalk>
pub async fn walk(&self, __request: &NpWalk) -> Result<RWalk>
Resolve path components to a fid (9P walk). Use the returned fid for open (I/O) or ctl operations (git log/diff/blame). Each use requires a separate fid.
Scope: query
Sourcepub async fn open(&self, __request: &NpOpen) -> Result<ROpen>
pub async fn open(&self, __request: &NpOpen) -> Result<ROpen>
Open a walked fid for read/write I/O. After open, the fid can only be used for read/write — ctl operations (log, diff, blame) require a separate walked-not-opened fid.
Scope: write
Sourcepub async fn create(&self, __request: &NpCreate) -> Result<ROpen>
pub async fn create(&self, __request: &NpCreate) -> Result<ROpen>
Create a file or directory under a walked directory fid. The fid is then opened for I/O on the new file.
Scope: write
Sourcepub async fn read(&self, __request: &NpRead) -> Result<RRead>
pub async fn read(&self, __request: &NpRead) -> Result<RRead>
Read file content or directory listing at offset+count (bounded by iounit). For directories, returns entries as binary: name_len(u32) + name + is_dir(u8) + size(u64).
Scope: query
Sourcepub async fn write(&self, __request: &NpWrite) -> Result<RWrite>
pub async fn write(&self, __request: &NpWrite) -> Result<RWrite>
Write data to an opened file at offset. Data size must not exceed iounit.
Scope: write
Sourcepub async fn clunk(&self, __request: &NpClunk) -> Result<()>
pub async fn clunk(&self, __request: &NpClunk) -> Result<()>
Release a fid (like close). Frees server resources. Always clunk fids when done.
Scope: query
Sourcepub async fn remove(&self, __request: &NpRemove) -> Result<()>
pub async fn remove(&self, __request: &NpRemove) -> Result<()>
Remove a file or directory and release its fid.
Scope: manage
Sourcepub async fn np_stat(&self, __request: &NpStatReq) -> Result<RStat>
pub async fn np_stat(&self, __request: &NpStatReq) -> Result<RStat>
Get file metadata (size, mode, timestamps). Works on both walked and opened fids.
Scope: query
Sourcepub async fn wstat(&self, __request: &NpWstat) -> Result<()>
pub async fn wstat(&self, __request: &NpWstat) -> Result<()>
Modify file metadata (truncate, rename). Requires an opened fid for truncate.
Scope: write
Sourcepub async fn flush(&self, __request: &NpFlush) -> Result<()>
pub async fn flush(&self, __request: &NpFlush) -> Result<()>
Cancel a pending operation by its tag.
Scope: query
Sourcepub async fn stage_all(&self) -> Result<()>
pub async fn stage_all(&self) -> Result<()>
Stage all modified tracked files in this worktree
Scope: write
Sourcepub async fn stage_files(&self, __request: &StageFilesRequest) -> Result<()>
pub async fn stage_files(&self, __request: &StageFilesRequest) -> Result<()>
Stage specific files in this worktree
Scope: write
Sourcepub async fn stage_all_including_untracked(&self) -> Result<()>
pub async fn stage_all_including_untracked(&self) -> Result<()>
Stage all files including untracked in this worktree
Scope: write
Sourcepub async fn commit(&self, __request: &CommitRequest) -> Result<String>
pub async fn commit(&self, __request: &CommitRequest) -> Result<String>
Commit staged changes in this worktree
Scope: write
Commit staged changes with specified author
Scope: write
Sourcepub async fn amend_commit(
&self,
__request: &AmendCommitRequest,
) -> Result<String>
pub async fn amend_commit( &self, __request: &AmendCommitRequest, ) -> Result<String>
Amend the last commit in this worktree
Scope: write
Sourcepub async fn checkout(&self, __request: &CheckoutRequest) -> Result<()>
pub async fn checkout(&self, __request: &CheckoutRequest) -> Result<()>
Checkout a ref in this worktree
Scope: write
Sourcepub async fn merge(&self, __request: &MergeRequest) -> Result<()>
pub async fn merge(&self, __request: &MergeRequest) -> Result<()>
Merge a branch into this worktree
Scope: write
Sourcepub async fn abort_merge(&self) -> Result<()>
pub async fn abort_merge(&self) -> Result<()>
Abort an in-progress merge in this worktree
Scope: write
Sourcepub async fn continue_merge(
&self,
__request: &ContinueMergeRequest,
) -> Result<()>
pub async fn continue_merge( &self, __request: &ContinueMergeRequest, ) -> Result<()>
Continue a merge after resolving conflicts
Scope: write
Sourcepub async fn quit_merge(&self) -> Result<()>
pub async fn quit_merge(&self) -> Result<()>
Exit merge state without committing
Scope: write
Source§impl WorktreeClient
impl WorktreeClient
Trait Implementations§
Source§impl Clone for WorktreeClient
impl Clone for WorktreeClient
Source§fn clone(&self) -> WorktreeClient
fn clone(&self) -> WorktreeClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl WorktreeRpc for WorktreeClient
impl WorktreeRpc for WorktreeClient
type Ctl = CtlClient
fn ctl(&self, fid: u32) -> Self::Ctl
fn walk<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpWalk,
) -> Pin<Box<dyn Future<Output = Result<RWalk>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn open<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpOpen,
) -> Pin<Box<dyn Future<Output = Result<ROpen>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpCreate,
) -> Pin<Box<dyn Future<Output = Result<ROpen>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpRead,
) -> Pin<Box<dyn Future<Output = Result<RRead>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpWrite,
) -> Pin<Box<dyn Future<Output = Result<RWrite>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clunk<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpClunk,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpRemove,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn np_stat<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpStatReq,
) -> Pin<Box<dyn Future<Output = Result<RStat>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wstat<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpWstat,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn flush<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpFlush,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stage_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stage_files<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 StageFilesRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stage_all_including_untracked<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CommitRequest,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn amend_commit<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 AmendCommitRequest,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn merge<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 MergeRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn abort_merge<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn continue_merge<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ContinueMergeRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn quit_merge<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_read<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NpStatReq,
) -> Pin<Box<dyn Future<Output = Result<ROpen>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for WorktreeClient
impl !RefUnwindSafe for WorktreeClient
impl Send for WorktreeClient
impl Sync for WorktreeClient
impl Unpin for WorktreeClient
impl UnsafeUnpin for WorktreeClient
impl !UnwindSafe for WorktreeClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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