Skip to main content

grit_lib/remote/
mod.rs

1//! Remotes, fetch/push, transport, and credential helpers.
2//!
3//! Remote operations return [`RemoteResult`] / [`RemoteError`]; use [`RemoteError::is_cancelled`]
4//! and [`RemoteError::is_remote_unreadable`] instead of matching nested library errors.
5//!
6//! Library guide: [mod](https://grit-scm.com/docs/library/network)
7//!
8//! ```rust
9//! use grit_lib::repo::{InitOptions, Repository};
10//! # fn main() -> grit_lib::error::Result<()> {
11//! let dir = tempfile::tempdir()?;
12//! let _repo = Repository::init(dir.path(), &InitOptions::default())?;
13//! let _ = _repo.remotes();
14//!
15//! # Ok(())
16//! # }
17//! ```
18mod core;
19mod inspect;
20pub mod push_plan;
21
22pub(crate) use core::is_valid_remote_name;
23pub use core::*;
24pub use inspect::{
25    inspect_remote, InspectOptions, RemoteBranchState, RemoteBranchStateKind, RemotePullBranch,
26    RemoteSummary,
27};
28
29pub mod fetch {
30    //! fetch API (re-exported at this path).
31    pub use crate::fetch::*;
32}
33pub mod fetch_request {
34    //! Explicit fetch refspec resolution.
35    pub use crate::fetch_request::*;
36}
37pub mod push {
38    //! push API (re-exported at this path).
39    pub use crate::push::*;
40}
41pub mod credentials {
42    //! credentials API (re-exported at this path).
43    pub use crate::credentials::*;
44}
45pub mod github_auth {
46    //! github_auth API (re-exported at this path).
47    pub use crate::github_auth::*;
48}
49pub mod push_bundle {
50    //! resumable push API (re-exported at this path).
51    pub use crate::push_bundle::*;
52}
53pub mod snapshot_checkout {
54    //! snapshot checkout API (re-exported at this path).
55    pub use crate::snapshot_checkout::*;
56}
57pub mod resumable {
58    //! resumable transfer API (re-exported at this path).
59    pub use crate::resumable::*;
60}
61pub mod bundle_uri {
62    //! bundle-uri API (re-exported at this path).
63    pub use crate::bundle_uri::*;
64}
65pub mod grit_server_auth {
66    //! grit_server_auth API (re-exported at this path).
67    pub use crate::grit_server_auth::*;
68}
69pub mod url_rewrite {
70    //! url_rewrite API (re-exported at this path).
71    pub use crate::url_rewrite::*;
72}
73pub mod transfer {
74    //! transfer API (re-exported at this path).
75    pub use crate::transfer::*;
76}
77pub mod transport {
78    //! transport API (re-exported at this path).
79    pub use crate::transport::*;
80}
81pub mod transport_path {
82    //! transport_path API (re-exported at this path).
83    pub use crate::transport_path::*;
84}
85pub mod protocol {
86    //! protocol API (re-exported at this path).
87    pub use crate::protocol::*;
88}
89pub mod protocol_v2 {
90    //! protocol_v2 API (re-exported at this path).
91    pub use crate::protocol_v2::*;
92}
93pub mod shallow {
94    //! shallow API (re-exported at this path).
95    pub use crate::shallow::*;
96}
97pub mod fetch_head {
98    //! fetch_head API (re-exported at this path).
99    pub use crate::fetch_head::*;
100}
101pub mod fetch_negotiator {
102    //! fetch_negotiator API (re-exported at this path).
103    pub use crate::fetch_negotiator::*;
104}
105pub mod receive_pack {
106    //! receive_pack API (re-exported at this path).
107    pub use crate::receive_pack::*;
108}
109pub mod push_report {
110    //! push_report API (re-exported at this path).
111    pub use crate::push_report::*;
112}
113pub mod clone {
114    //! clone API (re-exported at this path).
115    pub use crate::clone::*;
116}
117pub mod partial_clone {
118    //! Partial-clone filter specs and promisor-remote config.
119    pub use crate::partial_clone::*;
120}
121pub mod serve {
122    //! serve API (re-exported at this path).
123    pub use crate::serve::*;
124}
125pub mod pkt_line {
126    //! pkt_line API (re-exported at this path).
127    pub use crate::pkt_line::*;
128}
129pub mod sideband_lines {
130    //! sideband_lines API (re-exported at this path).
131    pub use crate::sideband_lines::*;
132}