pub struct RaSvnClient { /* private fields */ }Expand description
A reusable configuration object for connecting to an svn:// server.
Use RaSvnClient::open_session to create a connected RaSvnSession.
Implementations§
Source§impl RaSvnClient
impl RaSvnClient
Sourcepub async fn get_latest_rev(&self) -> Result<u64, SvnError>
pub async fn get_latest_rev(&self) -> Result<u64, SvnError>
Convenience wrapper for RaSvnSession::get_latest_rev.
Sourcepub async fn get_file<W: AsyncWrite + Unpin>(
&self,
path: &str,
rev: u64,
want_props: bool,
out: &mut W,
max_bytes: u64,
) -> Result<u64, SvnError>
pub async fn get_file<W: AsyncWrite + Unpin>( &self, path: &str, rev: u64, want_props: bool, out: &mut W, max_bytes: u64, ) -> Result<u64, SvnError>
Convenience wrapper for RaSvnSession::get_file.
Sourcepub async fn get_file_bytes(
&self,
path: &str,
rev: u64,
max_bytes: u64,
) -> Result<Vec<u8>, SvnError>
pub async fn get_file_bytes( &self, path: &str, rev: u64, max_bytes: u64, ) -> Result<Vec<u8>, SvnError>
Convenience wrapper for RaSvnSession::get_file_bytes.
Sourcepub async fn get_file_with_options<W: AsyncWrite + Unpin>(
&self,
path: &str,
options: &GetFileOptions,
out: &mut W,
) -> Result<GetFileResult, SvnError>
pub async fn get_file_with_options<W: AsyncWrite + Unpin>( &self, path: &str, options: &GetFileOptions, out: &mut W, ) -> Result<GetFileResult, SvnError>
Convenience wrapper for RaSvnSession::get_file_with_options.
Sourcepub async fn get_file_with_result<W: AsyncWrite + Unpin>(
&self,
path: &str,
rev: u64,
want_props: bool,
out: &mut W,
max_bytes: u64,
) -> Result<GetFileResult, SvnError>
pub async fn get_file_with_result<W: AsyncWrite + Unpin>( &self, path: &str, rev: u64, want_props: bool, out: &mut W, max_bytes: u64, ) -> Result<GetFileResult, SvnError>
Convenience wrapper for RaSvnSession::get_file_with_result.
Sourcepub async fn log(
&self,
start_rev: u64,
end_rev: u64,
) -> Result<Vec<LogEntry>, SvnError>
pub async fn log( &self, start_rev: u64, end_rev: u64, ) -> Result<Vec<LogEntry>, SvnError>
Convenience wrapper for RaSvnSession::log.
Sourcepub async fn log_with_options(
&self,
options: &LogOptions,
) -> Result<Vec<LogEntry>, SvnError>
pub async fn log_with_options( &self, options: &LogOptions, ) -> Result<Vec<LogEntry>, SvnError>
Convenience wrapper for RaSvnSession::log_with_options.
Sourcepub async fn log_each<F>(
&self,
options: &LogOptions,
on_entry: F,
) -> Result<(), SvnError>
pub async fn log_each<F>( &self, options: &LogOptions, on_entry: F, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::log_each.
Sourcepub async fn log_each_retrying<F>(
&self,
options: &LogOptions,
on_entry: F,
) -> Result<(), SvnError>
pub async fn log_each_retrying<F>( &self, options: &LogOptions, on_entry: F, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::log_each_retrying.
Sourcepub async fn get_dated_rev(&self, date: &str) -> Result<u64, SvnError>
pub async fn get_dated_rev(&self, date: &str) -> Result<u64, SvnError>
Convenience wrapper for RaSvnSession::get_dated_rev.
Sourcepub async fn get_mergeinfo(
&self,
paths: &[String],
rev: Option<u64>,
inherit: MergeInfoInheritance,
include_descendants: bool,
) -> Result<MergeInfoCatalog, SvnError>
pub async fn get_mergeinfo( &self, paths: &[String], rev: Option<u64>, inherit: MergeInfoInheritance, include_descendants: bool, ) -> Result<MergeInfoCatalog, SvnError>
Convenience wrapper for RaSvnSession::get_mergeinfo.
Sourcepub async fn get_deleted_rev(
&self,
path: &str,
peg_rev: u64,
end_rev: u64,
) -> Result<Option<u64>, SvnError>
pub async fn get_deleted_rev( &self, path: &str, peg_rev: u64, end_rev: u64, ) -> Result<Option<u64>, SvnError>
Convenience wrapper for RaSvnSession::get_deleted_rev.
Sourcepub async fn get_locations(
&self,
path: &str,
peg_rev: u64,
location_revs: &[u64],
) -> Result<Vec<LocationEntry>, SvnError>
pub async fn get_locations( &self, path: &str, peg_rev: u64, location_revs: &[u64], ) -> Result<Vec<LocationEntry>, SvnError>
Convenience wrapper for RaSvnSession::get_locations.
Sourcepub async fn get_location_segments(
&self,
path: &str,
peg_rev: u64,
start_rev: Option<u64>,
end_rev: Option<u64>,
) -> Result<Vec<LocationSegment>, SvnError>
pub async fn get_location_segments( &self, path: &str, peg_rev: u64, start_rev: Option<u64>, end_rev: Option<u64>, ) -> Result<Vec<LocationSegment>, SvnError>
Convenience wrapper for RaSvnSession::get_location_segments.
Sourcepub async fn get_file_revs(
&self,
path: &str,
start_rev: Option<u64>,
end_rev: Option<u64>,
include_merged_revisions: bool,
) -> Result<Vec<FileRev>, SvnError>
pub async fn get_file_revs( &self, path: &str, start_rev: Option<u64>, end_rev: Option<u64>, include_merged_revisions: bool, ) -> Result<Vec<FileRev>, SvnError>
Convenience wrapper for RaSvnSession::get_file_revs.
Sourcepub async fn get_file_revs_each<F>(
&self,
path: &str,
start_rev: Option<u64>,
end_rev: Option<u64>,
include_merged_revisions: bool,
on_rev: F,
) -> Result<(), SvnError>
pub async fn get_file_revs_each<F>( &self, path: &str, start_rev: Option<u64>, end_rev: Option<u64>, include_merged_revisions: bool, on_rev: F, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::get_file_revs_each.
Sourcepub async fn get_file_revs_with_contents(
&self,
path: &str,
start_rev: Option<u64>,
end_rev: Option<u64>,
include_merged_revisions: bool,
max_bytes: u64,
) -> Result<Vec<FileRevContents>, SvnError>
pub async fn get_file_revs_with_contents( &self, path: &str, start_rev: Option<u64>, end_rev: Option<u64>, include_merged_revisions: bool, max_bytes: u64, ) -> Result<Vec<FileRevContents>, SvnError>
Convenience wrapper for RaSvnSession::get_file_revs_with_contents.
Sourcepub async fn rev_proplist(&self, rev: u64) -> Result<PropertyList, SvnError>
pub async fn rev_proplist(&self, rev: u64) -> Result<PropertyList, SvnError>
Convenience wrapper for RaSvnSession::rev_proplist.
Sourcepub async fn rev_prop(
&self,
rev: u64,
name: &str,
) -> Result<Option<Vec<u8>>, SvnError>
pub async fn rev_prop( &self, rev: u64, name: &str, ) -> Result<Option<Vec<u8>>, SvnError>
Convenience wrapper for RaSvnSession::rev_prop.
Sourcepub async fn change_rev_prop(
&self,
rev: u64,
name: &str,
value: Option<Vec<u8>>,
) -> Result<(), SvnError>
pub async fn change_rev_prop( &self, rev: u64, name: &str, value: Option<Vec<u8>>, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::change_rev_prop.
Sourcepub async fn change_rev_prop2(
&self,
rev: u64,
name: &str,
value: Option<Vec<u8>>,
dont_care: bool,
previous_value: Option<Vec<u8>>,
) -> Result<(), SvnError>
pub async fn change_rev_prop2( &self, rev: u64, name: &str, value: Option<Vec<u8>>, dont_care: bool, previous_value: Option<Vec<u8>>, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::change_rev_prop2.
Sourcepub async fn proplist(
&self,
path: &str,
rev: Option<u64>,
) -> Result<Option<PropertyList>, SvnError>
pub async fn proplist( &self, path: &str, rev: Option<u64>, ) -> Result<Option<PropertyList>, SvnError>
Convenience wrapper for RaSvnSession::proplist.
Sourcepub async fn propget(
&self,
path: &str,
rev: Option<u64>,
name: &str,
) -> Result<Option<Vec<u8>>, SvnError>
pub async fn propget( &self, path: &str, rev: Option<u64>, name: &str, ) -> Result<Option<Vec<u8>>, SvnError>
Convenience wrapper for RaSvnSession::propget.
Sourcepub async fn inherited_props(
&self,
path: &str,
rev: Option<u64>,
) -> Result<Vec<InheritedProps>, SvnError>
pub async fn inherited_props( &self, path: &str, rev: Option<u64>, ) -> Result<Vec<InheritedProps>, SvnError>
Convenience wrapper for RaSvnSession::inherited_props.
Sourcepub async fn get_lock(&self, path: &str) -> Result<Option<LockDesc>, SvnError>
pub async fn get_lock(&self, path: &str) -> Result<Option<LockDesc>, SvnError>
Convenience wrapper for RaSvnSession::get_lock.
Sourcepub async fn get_locks(
&self,
path: &str,
depth: Depth,
) -> Result<Vec<LockDesc>, SvnError>
pub async fn get_locks( &self, path: &str, depth: Depth, ) -> Result<Vec<LockDesc>, SvnError>
Convenience wrapper for RaSvnSession::get_locks.
Sourcepub async fn lock(
&self,
path: &str,
options: &LockOptions,
) -> Result<LockDesc, SvnError>
pub async fn lock( &self, path: &str, options: &LockOptions, ) -> Result<LockDesc, SvnError>
Convenience wrapper for RaSvnSession::lock.
Sourcepub async fn lock_many(
&self,
options: &LockManyOptions,
targets: &[LockTarget],
) -> Result<Vec<Result<LockDesc, SvnError>>, SvnError>
pub async fn lock_many( &self, options: &LockManyOptions, targets: &[LockTarget], ) -> Result<Vec<Result<LockDesc, SvnError>>, SvnError>
Convenience wrapper for RaSvnSession::lock_many.
Sourcepub async fn unlock(
&self,
path: &str,
options: &UnlockOptions,
) -> Result<(), SvnError>
pub async fn unlock( &self, path: &str, options: &UnlockOptions, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::unlock.
Sourcepub async fn unlock_many(
&self,
options: &UnlockManyOptions,
targets: &[UnlockTarget],
) -> Result<Vec<Result<String, SvnError>>, SvnError>
pub async fn unlock_many( &self, options: &UnlockManyOptions, targets: &[UnlockTarget], ) -> Result<Vec<Result<String, SvnError>>, SvnError>
Convenience wrapper for RaSvnSession::unlock_many.
Sourcepub async fn commit(
&self,
options: &CommitOptions,
commands: &[EditorCommand],
) -> Result<CommitInfo, SvnError>
pub async fn commit( &self, options: &CommitOptions, commands: &[EditorCommand], ) -> Result<CommitInfo, SvnError>
Convenience wrapper for RaSvnSession::commit.
Sourcepub async fn list_dir(
&self,
path: &str,
rev: Option<u64>,
) -> Result<DirListing, SvnError>
pub async fn list_dir( &self, path: &str, rev: Option<u64>, ) -> Result<DirListing, SvnError>
Convenience wrapper for RaSvnSession::list_dir.
Sourcepub async fn list_dir_with_fields(
&self,
path: &str,
rev: Option<u64>,
fields: &[DirentField],
) -> Result<DirListing, SvnError>
pub async fn list_dir_with_fields( &self, path: &str, rev: Option<u64>, fields: &[DirentField], ) -> Result<DirListing, SvnError>
Convenience wrapper for RaSvnSession::list_dir_with_fields.
Sourcepub async fn check_path(
&self,
path: &str,
rev: Option<u64>,
) -> Result<NodeKind, SvnError>
pub async fn check_path( &self, path: &str, rev: Option<u64>, ) -> Result<NodeKind, SvnError>
Convenience wrapper for RaSvnSession::check_path.
Sourcepub async fn stat(
&self,
path: &str,
rev: Option<u64>,
) -> Result<Option<StatEntry>, SvnError>
pub async fn stat( &self, path: &str, rev: Option<u64>, ) -> Result<Option<StatEntry>, SvnError>
Convenience wrapper for RaSvnSession::stat.
Sourcepub async fn list(
&self,
path: &str,
rev: Option<u64>,
depth: Depth,
fields: &[DirentField],
patterns: Option<&[String]>,
) -> Result<Vec<DirEntry>, SvnError>
pub async fn list( &self, path: &str, rev: Option<u64>, depth: Depth, fields: &[DirentField], patterns: Option<&[String]>, ) -> Result<Vec<DirEntry>, SvnError>
Convenience wrapper for RaSvnSession::list.
Sourcepub async fn list_with_options(
&self,
options: &ListOptions,
) -> Result<Vec<DirEntry>, SvnError>
pub async fn list_with_options( &self, options: &ListOptions, ) -> Result<Vec<DirEntry>, SvnError>
Convenience wrapper for RaSvnSession::list_with_options.
Sourcepub async fn list_with_options_each<F>(
&self,
options: &ListOptions,
on_entry: F,
) -> Result<(), SvnError>
pub async fn list_with_options_each<F>( &self, options: &ListOptions, on_entry: F, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::list_with_options_each.
Sourcepub async fn list_recursive(
&self,
path: &str,
rev: Option<u64>,
) -> Result<Vec<DirEntry>, SvnError>
pub async fn list_recursive( &self, path: &str, rev: Option<u64>, ) -> Result<Vec<DirEntry>, SvnError>
Convenience wrapper for RaSvnSession::list_recursive.
Sourcepub async fn update(
&self,
options: &UpdateOptions,
report: &Report,
handler: &mut dyn EditorEventHandler,
) -> Result<(), SvnError>
pub async fn update( &self, options: &UpdateOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::update.
Sourcepub async fn update_with_async_handler(
&self,
options: &UpdateOptions,
report: &Report,
handler: &mut dyn AsyncEditorEventHandler,
) -> Result<(), SvnError>
pub async fn update_with_async_handler( &self, options: &UpdateOptions, report: &Report, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::update_with_async_handler.
Sourcepub async fn switch(
&self,
options: &SwitchOptions,
report: &Report,
handler: &mut dyn EditorEventHandler,
) -> Result<(), SvnError>
pub async fn switch( &self, options: &SwitchOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::switch.
Sourcepub async fn switch_with_async_handler(
&self,
options: &SwitchOptions,
report: &Report,
handler: &mut dyn AsyncEditorEventHandler,
) -> Result<(), SvnError>
pub async fn switch_with_async_handler( &self, options: &SwitchOptions, report: &Report, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::switch_with_async_handler.
Sourcepub async fn status(
&self,
options: &StatusOptions,
report: &Report,
handler: &mut dyn EditorEventHandler,
) -> Result<(), SvnError>
pub async fn status( &self, options: &StatusOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::status.
Sourcepub async fn status_with_async_handler(
&self,
options: &StatusOptions,
report: &Report,
handler: &mut dyn AsyncEditorEventHandler,
) -> Result<(), SvnError>
pub async fn status_with_async_handler( &self, options: &StatusOptions, report: &Report, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::status_with_async_handler.
Sourcepub async fn diff(
&self,
options: &DiffOptions,
report: &Report,
handler: &mut dyn EditorEventHandler,
) -> Result<(), SvnError>
pub async fn diff( &self, options: &DiffOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::diff.
Sourcepub async fn diff_with_async_handler(
&self,
options: &DiffOptions,
report: &Report,
handler: &mut dyn AsyncEditorEventHandler,
) -> Result<(), SvnError>
pub async fn diff_with_async_handler( &self, options: &DiffOptions, report: &Report, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::diff_with_async_handler.
Sourcepub async fn replay(
&self,
options: &ReplayOptions,
handler: &mut dyn EditorEventHandler,
) -> Result<(), SvnError>
pub async fn replay( &self, options: &ReplayOptions, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::replay.
Sourcepub async fn replay_with_async_handler(
&self,
options: &ReplayOptions,
handler: &mut dyn AsyncEditorEventHandler,
) -> Result<(), SvnError>
pub async fn replay_with_async_handler( &self, options: &ReplayOptions, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::replay_with_async_handler.
Sourcepub async fn replay_range(
&self,
options: &ReplayRangeOptions,
handler: &mut dyn EditorEventHandler,
) -> Result<(), SvnError>
pub async fn replay_range( &self, options: &ReplayRangeOptions, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::replay_range.
Sourcepub async fn replay_range_with_async_handler(
&self,
options: &ReplayRangeOptions,
handler: &mut dyn AsyncEditorEventHandler,
) -> Result<(), SvnError>
pub async fn replay_range_with_async_handler( &self, options: &ReplayRangeOptions, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::replay_range_with_async_handler.
Source§impl RaSvnClient
impl RaSvnClient
Sourcepub fn new(
base_url: SvnUrl,
username: Option<String>,
password: Option<String>,
) -> Self
pub fn new( base_url: SvnUrl, username: Option<String>, password: Option<String>, ) -> Self
Creates a client configuration for a repository URL and optional credentials.
Credentials are used when the server offers an auth mechanism supported by
this crate (for example PLAIN or CRAM-MD5).
Sourcepub fn connect_timeout(&self) -> Duration
pub fn connect_timeout(&self) -> Duration
Returns the configured connect timeout.
Sourcepub fn read_timeout(&self) -> Duration
pub fn read_timeout(&self) -> Duration
Returns the configured read timeout.
Sourcepub fn write_timeout(&self) -> Duration
pub fn write_timeout(&self) -> Duration
Returns the configured write timeout.
Sourcepub fn with_connect_timeout(self, connect_timeout: Duration) -> Self
pub fn with_connect_timeout(self, connect_timeout: Duration) -> Self
Sets the connect timeout.
Sourcepub fn with_read_timeout(self, read_timeout: Duration) -> Self
pub fn with_read_timeout(self, read_timeout: Duration) -> Self
Sets the read timeout.
Sourcepub fn with_write_timeout(self, write_timeout: Duration) -> Self
pub fn with_write_timeout(self, write_timeout: Duration) -> Self
Sets the write timeout.
Sourcepub fn with_ra_client(self, ra_client: impl Into<String>) -> Self
pub fn with_ra_client(self, ra_client: impl Into<String>) -> Self
Sets the ra_client string sent to the server during handshake.
Sourcepub fn with_reconnect_retries(self, retries: usize) -> Self
pub fn with_reconnect_retries(self, retries: usize) -> Self
Sets how many times to reconnect and retry an operation on transient
connection failures (for example unexpected EOF).
This affects:
- the initial handshake performed by
RaSvnClient::open_session; - per-operation reconnects performed by
RaSvnSessionmethods that use automatic retry.
0 disables retries (one attempt only). The default is 1.
Sourcepub fn reconnect_retries(&self) -> usize
pub fn reconnect_retries(&self) -> usize
Returns the configured reconnect retry count.
Sourcepub fn with_ssh_config(self, ssh: SshConfig) -> Self
Available on crate feature ssh only.
pub fn with_ssh_config(self, ssh: SshConfig) -> Self
ssh only.Sets the SSH transport configuration for svn+ssh:// URLs.
This is ignored for svn:// URLs.
Sourcepub async fn open_session(&self) -> Result<RaSvnSession, SvnError>
pub async fn open_session(&self) -> Result<RaSvnSession, SvnError>
Opens a new TCP connection, performs the ra_svn handshake, and returns a RaSvnSession.
Sourcepub async fn open_session_with_stream<S>(
&self,
stream: S,
) -> Result<RaSvnSession, SvnError>
pub async fn open_session_with_stream<S>( &self, stream: S, ) -> Result<RaSvnSession, SvnError>
Opens a session over an already connected stream.
This is useful if you want to provide your own transport (for example a
tunnel or custom proxy). The stream must already be connected to the
same host:port as RaSvnClient::base_url.
Sessions created by this method do not auto-reconnect on I/O errors (because the crate cannot recreate your custom transport). If the stream is dropped, create a new session yourself.
Source§impl RaSvnClient
impl RaSvnClient
Sourcepub async fn export_to_dir(
&self,
options: &UpdateOptions,
dest: impl AsRef<Path>,
) -> Result<(), SvnError>
pub async fn export_to_dir( &self, options: &UpdateOptions, dest: impl AsRef<Path>, ) -> Result<(), SvnError>
Convenience wrapper for RaSvnSession::export_to_dir.
Source§impl RaSvnClient
impl RaSvnClient
Sourcepub async fn diff_file_unified(
&self,
path: &str,
old_rev: u64,
new_rev: u64,
max_bytes: u64,
) -> Result<String, SvnError>
pub async fn diff_file_unified( &self, path: &str, old_rev: u64, new_rev: u64, max_bytes: u64, ) -> Result<String, SvnError>
Convenience wrapper for RaSvnSession::diff_file_unified.
Source§impl RaSvnClient
impl RaSvnClient
Sourcepub fn session_pool(&self, max_sessions: usize) -> Result<SessionPool, SvnError>
pub fn session_pool(&self, max_sessions: usize) -> Result<SessionPool, SvnError>
Creates a SessionPool using this client configuration.
Sourcepub fn session_pool_with_config(
&self,
config: SessionPoolConfig,
) -> Result<SessionPool, SvnError>
pub fn session_pool_with_config( &self, config: SessionPoolConfig, ) -> Result<SessionPool, SvnError>
Creates a SessionPool using this client configuration and config.
Trait Implementations§
Source§impl Clone for RaSvnClient
impl Clone for RaSvnClient
Source§fn clone(&self) -> RaSvnClient
fn clone(&self) -> RaSvnClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more