Skip to main content

RaSvnClient

Struct RaSvnClient 

Source
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

Source

pub async fn get_latest_rev(&self) -> Result<u64, SvnError>

Convenience wrapper for RaSvnSession::get_latest_rev.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn log( &self, start_rev: u64, end_rev: u64, ) -> Result<Vec<LogEntry>, SvnError>

Convenience wrapper for RaSvnSession::log.

Source

pub async fn log_with_options( &self, options: &LogOptions, ) -> Result<Vec<LogEntry>, SvnError>

Convenience wrapper for RaSvnSession::log_with_options.

Source

pub async fn log_each<F>( &self, options: &LogOptions, on_entry: F, ) -> Result<(), SvnError>
where F: FnMut(LogEntry) -> Result<(), SvnError> + Send,

Convenience wrapper for RaSvnSession::log_each.

Source

pub async fn log_each_retrying<F>( &self, options: &LogOptions, on_entry: F, ) -> Result<(), SvnError>
where F: FnMut(LogEntry) -> Result<(), SvnError> + Send,

Convenience wrapper for RaSvnSession::log_each_retrying.

Source

pub async fn get_dated_rev(&self, date: &str) -> Result<u64, SvnError>

Convenience wrapper for RaSvnSession::get_dated_rev.

Source

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.

Source

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.

Source

pub async fn get_locations( &self, path: &str, peg_rev: u64, location_revs: &[u64], ) -> Result<Vec<LocationEntry>, SvnError>

Convenience wrapper for RaSvnSession::get_locations.

Source

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.

Source

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.

Source

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>
where F: FnMut(FileRev) -> Result<(), SvnError> + Send,

Convenience wrapper for RaSvnSession::get_file_revs_each.

Source

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>

Source

pub async fn rev_proplist(&self, rev: u64) -> Result<PropertyList, SvnError>

Convenience wrapper for RaSvnSession::rev_proplist.

Source

pub async fn rev_prop( &self, rev: u64, name: &str, ) -> Result<Option<Vec<u8>>, SvnError>

Convenience wrapper for RaSvnSession::rev_prop.

Source

pub async fn change_rev_prop( &self, rev: u64, name: &str, value: Option<Vec<u8>>, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::change_rev_prop.

Source

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.

Source

pub async fn proplist( &self, path: &str, rev: Option<u64>, ) -> Result<Option<PropertyList>, SvnError>

Convenience wrapper for RaSvnSession::proplist.

Source

pub async fn propget( &self, path: &str, rev: Option<u64>, name: &str, ) -> Result<Option<Vec<u8>>, SvnError>

Convenience wrapper for RaSvnSession::propget.

Source

pub async fn inherited_props( &self, path: &str, rev: Option<u64>, ) -> Result<Vec<InheritedProps>, SvnError>

Convenience wrapper for RaSvnSession::inherited_props.

Source

pub async fn get_lock(&self, path: &str) -> Result<Option<LockDesc>, SvnError>

Convenience wrapper for RaSvnSession::get_lock.

Source

pub async fn get_locks( &self, path: &str, depth: Depth, ) -> Result<Vec<LockDesc>, SvnError>

Convenience wrapper for RaSvnSession::get_locks.

Source

pub async fn lock( &self, path: &str, options: &LockOptions, ) -> Result<LockDesc, SvnError>

Convenience wrapper for RaSvnSession::lock.

Source

pub async fn lock_many( &self, options: &LockManyOptions, targets: &[LockTarget], ) -> Result<Vec<Result<LockDesc, SvnError>>, SvnError>

Convenience wrapper for RaSvnSession::lock_many.

Source

pub async fn unlock( &self, path: &str, options: &UnlockOptions, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::unlock.

Source

pub async fn unlock_many( &self, options: &UnlockManyOptions, targets: &[UnlockTarget], ) -> Result<Vec<Result<String, SvnError>>, SvnError>

Convenience wrapper for RaSvnSession::unlock_many.

Source

pub async fn commit( &self, options: &CommitOptions, commands: &[EditorCommand], ) -> Result<CommitInfo, SvnError>

Convenience wrapper for RaSvnSession::commit.

Source

pub async fn list_dir( &self, path: &str, rev: Option<u64>, ) -> Result<DirListing, SvnError>

Convenience wrapper for RaSvnSession::list_dir.

Source

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.

Source

pub async fn check_path( &self, path: &str, rev: Option<u64>, ) -> Result<NodeKind, SvnError>

Convenience wrapper for RaSvnSession::check_path.

Source

pub async fn stat( &self, path: &str, rev: Option<u64>, ) -> Result<Option<StatEntry>, SvnError>

Convenience wrapper for RaSvnSession::stat.

Source

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.

Source

pub async fn list_with_options( &self, options: &ListOptions, ) -> Result<Vec<DirEntry>, SvnError>

Convenience wrapper for RaSvnSession::list_with_options.

Source

pub async fn list_with_options_each<F>( &self, options: &ListOptions, on_entry: F, ) -> Result<(), SvnError>
where F: FnMut(DirEntry) -> Result<(), SvnError> + Send,

Convenience wrapper for RaSvnSession::list_with_options_each.

Source

pub async fn list_recursive( &self, path: &str, rev: Option<u64>, ) -> Result<Vec<DirEntry>, SvnError>

Convenience wrapper for RaSvnSession::list_recursive.

Source

pub async fn update( &self, options: &UpdateOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::update.

Source

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.

Source

pub async fn switch( &self, options: &SwitchOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::switch.

Source

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.

Source

pub async fn status( &self, options: &StatusOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::status.

Source

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.

Source

pub async fn diff( &self, options: &DiffOptions, report: &Report, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::diff.

Source

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.

Source

pub async fn replay( &self, options: &ReplayOptions, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::replay.

Source

pub async fn replay_with_async_handler( &self, options: &ReplayOptions, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::replay_with_async_handler.

Source

pub async fn replay_range( &self, options: &ReplayRangeOptions, handler: &mut dyn EditorEventHandler, ) -> Result<(), SvnError>

Convenience wrapper for RaSvnSession::replay_range.

Source

pub async fn replay_range_with_async_handler( &self, options: &ReplayRangeOptions, handler: &mut dyn AsyncEditorEventHandler, ) -> Result<(), SvnError>

Source§

impl RaSvnClient

Source

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).

Source

pub fn base_url(&self) -> &SvnUrl

Returns the configured base URL.

Source

pub fn username(&self) -> Option<&str>

Returns the configured username, if any.

Source

pub fn connect_timeout(&self) -> Duration

Returns the configured connect timeout.

Source

pub fn read_timeout(&self) -> Duration

Returns the configured read timeout.

Source

pub fn write_timeout(&self) -> Duration

Returns the configured write timeout.

Source

pub fn ra_client(&self) -> &str

Returns the configured ra_client string sent during handshake.

Source

pub fn with_connect_timeout(self, connect_timeout: Duration) -> Self

Sets the connect timeout.

Source

pub fn with_read_timeout(self, read_timeout: Duration) -> Self

Sets the read timeout.

Source

pub fn with_write_timeout(self, write_timeout: Duration) -> Self

Sets the write timeout.

Source

pub fn with_ra_client(self, ra_client: impl Into<String>) -> Self

Sets the ra_client string sent to the server during handshake.

Source

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:

0 disables retries (one attempt only). The default is 1.

Source

pub fn reconnect_retries(&self) -> usize

Returns the configured reconnect retry count.

Source

pub fn with_ssh_config(self, ssh: SshConfig) -> Self

Available on crate feature ssh only.

Sets the SSH transport configuration for svn+ssh:// URLs.

This is ignored for svn:// URLs.

Source

pub async fn open_session(&self) -> Result<RaSvnSession, SvnError>

Opens a new TCP connection, performs the ra_svn handshake, and returns a RaSvnSession.

Source

pub async fn open_session_with_stream<S>( &self, stream: S, ) -> Result<RaSvnSession, SvnError>
where S: AsyncRead + AsyncWrite + Send + 'static,

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

Source

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

Source

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

pub async fn blame_file( &self, path: &str, start_rev: Option<u64>, end_rev: Option<u64>, include_merged_revisions: bool, max_bytes: u64, ) -> Result<Vec<BlameLine>, SvnError>

Convenience wrapper for RaSvnSession::blame_file.

Source§

impl RaSvnClient

Source

pub fn session_pool(&self, max_sessions: usize) -> Result<SessionPool, SvnError>

Creates a SessionPool using this client configuration.

Source

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

Source§

fn clone(&self) -> RaSvnClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RaSvnClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more