pub struct CtlClient { /* private fields */ }Expand description
Scoped client for ctl operations (transport-agnostic).
Implementations§
Source§impl CtlClient
impl CtlClient
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<CtlClientResponseVariant>
pub fn parse_scoped_response(bytes: &[u8]) -> Result<CtlClientResponseVariant>
Parse a scoped response from raw bytes.
Sourcepub async fn status(&self) -> Result<FileStatus>
pub async fn status(&self) -> Result<FileStatus>
Git status of this file. Requires a walked (not opened) fid.
Scope: query
Sourcepub async fn log(&self, __request: &CtlLogRequest) -> Result<Vec<LogEntry>>
pub async fn log(&self, __request: &CtlLogRequest) -> Result<Vec<LogEntry>>
Commits touching this file. Requires a walked (not opened) fid.
Scope: query
Sourcepub async fn diff(&self, __request: &CtlDiffRequest) -> Result<String>
pub async fn diff(&self, __request: &CtlDiffRequest) -> Result<String>
Diff this file against a ref. Requires a walked (not opened) fid.
Scope: query
Sourcepub async fn blame(&self) -> Result<String>
pub async fn blame(&self) -> Result<String>
Git blame for this file. Requires a walked (not opened) fid.
Scope: query
Sourcepub async fn checkout(&self, __request: &CtlCheckoutRequest) -> Result<()>
pub async fn checkout(&self, __request: &CtlCheckoutRequest) -> Result<()>
Restore file content from a ref
Scope: write
Sourcepub async fn validate(&self) -> Result<ValidationResult>
pub async fn validate(&self) -> Result<ValidationResult>
Validate file format. Requires a walked (not opened) fid.
Scope: query
Sourcepub async fn info(&self) -> Result<FileInfo>
pub async fn info(&self) -> Result<FileInfo>
File metadata and git state. Requires a walked (not opened) fid.
Scope: query
Sourcepub async fn edit_open(&self, __request: &EditOpenRequest) -> Result<()>
pub async fn edit_open(&self, __request: &EditOpenRequest) -> Result<()>
Open file for CRDT editing
Scope: write
Sourcepub async fn edit_state(&self) -> Result<String>
pub async fn edit_state(&self) -> Result<String>
Get current CRDT document state
Scope: query
Sourcepub async fn edit_apply(&self, __request: &EditApplyRequest) -> Result<()>
pub async fn edit_apply(&self, __request: &EditApplyRequest) -> Result<()>
Apply automerge CRDT change
Scope: write
Sourcepub async fn edit_close(&self) -> Result<()>
pub async fn edit_close(&self) -> Result<()>
Close CRDT editing session
Scope: write
Source§impl CtlClient
impl CtlClient
Trait Implementations§
Source§impl CtlRpc for CtlClient
impl CtlRpc for CtlClient
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<FileStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn log<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CtlLogRequest,
) -> Pin<Box<dyn Future<Output = Result<Vec<LogEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn diff<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CtlDiffRequest,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn blame<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CtlCheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ValidationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<FileInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn edit_open<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 EditOpenRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn edit_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn edit_apply<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 EditApplyRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn edit_close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ctl_flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for CtlClient
impl !RefUnwindSafe for CtlClient
impl Send for CtlClient
impl Sync for CtlClient
impl Unpin for CtlClient
impl UnsafeUnpin for CtlClient
impl !UnwindSafe for CtlClient
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