Expand description
Async client for Subversion’s svn:// (ra_svn) protocol.
This crate implements a subset of Subversion’s remote access protocol used by
svnserve (the svn:// scheme). It is a network client and does not
implement a working copy.
Most users should start with RaSvnClient to create a connected
RaSvnSession.
§Getting started
use std::time::Duration;
use svn::{RaSvnClient, SvnUrl};
fn main() -> svn::Result<()> {
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()?;
rt.block_on(async {
let url = SvnUrl::parse("svn://example.com/repo")?;
let client = RaSvnClient::new(url, None, None)
.with_read_timeout(Duration::from_secs(30));
// A session reuses one connection and caches server info.
let mut session = client.open_session().await?;
let latest = session.get_latest_rev().await?;
println!("{latest}");
Ok(())
})
}§Features
serde: enablesSerialize/Deserializefor public data types.cyrus-sasl: enables Cyrus SASL authentication and (when negotiated) the SASL security layer (requires a system-providedlibsasl2at runtime).ssh: enablessvn+ssh://by runningsvnserve -tover SSH (viarussh).
§Protocol notes
svn://is supported.svn+ssh://is supported with thesshfeature (seeSshConfig).- IPv6 URLs must use brackets (for example
svn://[::1]/repo). - Built-in authentication mechanisms:
ANONYMOUS,PLAIN, andCRAM-MD5. Withcyrus-sasl, the client can also use Cyrus SASL (including the optional SASL security layer when negotiated).
§Custom transports
If you need to bring your own transport (for example a custom proxy/tunnel),
you can connect the stream yourself and then call
RaSvnClient::open_session_with_stream.
§Low-level access
For raw wire protocol items, see raw::SvnItem.
Modules§
- raw
- Low-level wire-protocol types and helpers.
Structs§
- Blame
Line - One annotated line as returned by
crate::RaSvnSession::blame_file. - Changed
Path - A single path change entry within a
LogEntry. - Commit
Builder - High-level commit editor builder.
- Commit
Info - A successful commit result returned by
crate::RaSvnSession::commit. - Commit
Lock Token - A path/token pair to include in
crate::CommitOptions::lock_tokens. - Commit
Options - Options for
crate::RaSvnSession::commit. - Commit
Stream Builder - High-level commit builder that streams file contents from an
AsyncRead. - Diff
Options - Options for
crate::RaSvnSession::diff. - DirEntry
- A directory entry as returned by directory listing operations.
- DirListing
- Result of
get-diras returned bycrate::RaSvnSession::list_dir. - FileRev
- A file revision entry as returned by
get-file-revs. - File
RevContents - A
FileReventry with materialized file contents. - FsEditor
- Applies
update/switch/replay-style editor drives to a filesystem directory. - GetFile
Options - Options for
crate::RaSvnSession::get_file_with_options. - GetFile
Result - Result metadata returned by
crate::RaSvnSession::get_file_with_result. - Inherited
Props - Inherited properties for a path.
- List
Options - Options for
crate::RaSvnSession::list_with_options. - Location
Entry - A
(revision, path)pair as returned byget-locations. - Location
Segment - A location segment as returned by
get-location-segments. - Lock
Desc - A lock description as returned by
get-lock(s)orlock. - Lock
Many Options - Options for
crate::RaSvnSession::lock_many. - Lock
Options - Options for
crate::RaSvnSession::lock. - Lock
Target - A lock target for
crate::RaSvnSession::lock_many. - LogEntry
- A log entry returned by
log. - LogOptions
- Options for
crate::RaSvnSession::log_with_options. - Pooled
Session - A checked-out session returned by
SessionPool::session. - Prop
Delta - A single property delta entry (name + new value).
- RaSvn
Client - A reusable configuration object for connecting to an
svn://server. - RaSvn
Session - A connected, stateful session to an
svn://server. - Recorded
Text Delta - A fully recorded textdelta stream for one file token.
- Replay
Options - Options for
crate::RaSvnSession::replay. - Replay
Range Options - Options for
crate::RaSvnSession::replay_range. - Report
- A sequence of
ReportCommandvalues. - Repository
Info - Repository metadata returned by the server.
- Server
Error - A structured server error returned by
svnserve. - Server
Error Item - One error entry as returned by a server-side
failureresponse. - Server
Info - Information negotiated during the initial handshake.
- Session
Pool - A bounded pool of connected
RaSvnSessionvalues. - Session
Pool Config - Configuration for
SessionPool. - Session
Pool Key - A key used by
SessionPoolsto partition pools byhost:portand an optional custom key. - Session
Pools - A map of
SessionPoolvalues partitioned byhost:portand an optional key. - SshConfig
ssh - Configuration for the
svn+ssh://transport. - Stat
Entry - A
statresult entry. - Status
Options - Options for
crate::RaSvnSession::status. - SvnUrl
- A normalized Subversion repository URL.
- Switch
Options - Options for
crate::RaSvnSession::switch. - Text
Delta Applier - Incrementally applies an svndiff textdelta to a base file.
- Text
Delta Applier Sync - Incrementally applies an svndiff textdelta to a base file, writing to a synchronous
std::io::Write. - Text
Delta Recorder - Records
apply-textdeltastreams from an editor drive. - Tokio
FsEditor - Applies
update/switch/replay-style editor drives to a filesystem directory using asynctokio::fsI/O. - Unlock
Many Options - Options for
crate::RaSvnSession::unlock_many. - Unlock
Options - Options for
crate::RaSvnSession::unlock. - Unlock
Target - An unlock target for
crate::RaSvnSession::unlock_many. - Update
Options - Options for
crate::RaSvnSession::update.
Enums§
- Capability
- A protocol capability that may be announced during handshake.
- Depth
- Subversion depth value (used by
list,update,switch,status, etc.). - Dirent
Field - Fields to request for directory entries when using the
listcapability. - Editor
Command - Client-to-server editor commands for
crate::RaSvnSession::commit. - Editor
Event - Server-to-client editor events returned by report-driven operations.
- LogRev
Props - Which revision properties to request for
logoperations. - Merge
Info Inheritance - Controls how mergeinfo may be inherited when requesting mergeinfo.
- Node
Kind - The kind of a node in the repository.
- Report
Command - Client-to-server report commands used by operations like
update/switch. - Session
Pool Health Check - Health check behavior for
SessionPoolidle sessions. - SshAuth
ssh - SSH authentication options for
svn+ssh://transports. - SshHost
KeyPolicy ssh - SSH host key verification policy.
- SvnError
- Errors returned by this crate.
- Svndiff
Mode - Svndiff version selection for
CommitBuilder.
Traits§
- Async
Editor Event Handler - Async handler for server-to-client
EditorEventstreams. - Editor
Event Handler - Handler for server-to-client
EditorEventstreams.
Functions§
- apply_
textdelta - Applies an svndiff textdelta (svndiff0/1/2) to
baseand writes the result toout. - apply_
textdelta_ sync - Applies an svndiff textdelta (svndiff0/1/2) to
baseand writes the result toout.
Type Aliases§
- Merge
Info Catalog - A map of
path -> mergeinfostrings as returned byget-mergeinfo. - Property
List - A Subversion property list (
name -> raw bytes). - Result
- Convenience alias for results returned by this crate.