| 1 | //! Interact with git credentials in various ways and launch helper programs. |
| 2 | //! |
| 3 | //! ## Feature Flags |
| 4 | #![cfg_attr( |
| 5 | all(doc, feature = "document-features"), |
| 6 | doc = ::document_features::document_features!() |
| 7 | )] |
| 8 | #![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg))] |
| 9 | #![deny(missing_docs, rust_2018_idioms)] |
| 10 | #![forbid(unsafe_code)] |
| 11 | |
| 12 | /// A program/executable implementing the credential helper protocol. |
| 13 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 14 | pub struct Programrust-analyzer cargo gix-credentials 0.38.0 Program# { |
| 15 | /// The kind of program, ready for launch. |
| 16 | pub kindrust-analyzer cargo gix-credentials 0.38.0 Program#kind.: programrust-analyzer cargo gix-credentials 0.38.0 program/::Kindrust-analyzer cargo gix-credentials 0.38.0 program/Kind#, |
| 17 | /// If true, stderr is enabled, which is the default. |
| 18 | pub stderrrust-analyzer cargo gix-credentials 0.38.0 Program#stderr.: bool, |
| 19 | /// `Some(…)` if the process is running. |
| 20 | childrust-analyzer cargo gix-credentials 0.38.0 Program#child.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::processrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/::Childrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Child#>, |
| 21 | } |
| 22 | |
| 23 | /// |
| 24 | pub mod helperrust-analyzer cargo gix-credentials 0.38.0 helper/; |
| 25 | |
| 26 | /// |
| 27 | pub mod programrust-analyzer cargo gix-credentials 0.38.0 program/; |
| 28 | |
| 29 | /// |
| 30 | pub mod protocolrust-analyzer cargo gix-credentials 0.38.0 protocol/; |
| 31 | |
| 32 | /// Call the `git credential` helper program performing the given `action`, which reads all context from the git configuration |
| 33 | /// and does everything `git` typically does. The `action` should have been created with [`helper::Action::get_for_url()`] to |
| 34 | /// contain only the URL to kick off the process, or should be created by [`helper::NextAction`]. |
| 35 | /// |
| 36 | /// If more control is required, use the [`Cascade`][helper::Cascade] type. |
| 37 | #[allow(clippy::result_large_err)] |
| 38 | pub fn builtinrust-analyzer cargo gix-credentials 0.38.0 builtin().(action: helperrust-analyzer cargo gix-credentials 0.38.0 helper/::Actionrust-analyzer cargo gix-credentials 0.38.0 helper/Action#) -> protocolrust-analyzer cargo gix-credentials 0.38.0 protocol/::Resultrust-analyzer cargo gix-credentials 0.38.0 protocol/Result# { |
| 39 | protocolrust-analyzer cargo gix-credentials 0.38.0 protocol/::helper_outcome_to_resultrust-analyzer cargo gix-credentials 0.38.0 protocol/helper_outcome_to_result().( |
| 40 | helperrust-analyzer cargo gix-credentials 0.38.0 helper/::invokerust-analyzer cargo gix-credentials 0.38.0 helper/invoke/invoke().(&mut Programrust-analyzer cargo gix-credentials 0.38.0 Program#::from_kindrust-analyzer cargo gix-credentials 0.38.0 program/impl#[Program]from_kind().(programrust-analyzer cargo gix-credentials 0.38.0 program/::Kindrust-analyzer cargo gix-credentials 0.38.0 program/Kind#::Builtinrust-analyzer cargo gix-credentials 0.38.0 program/Kind#Builtin#), &action)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 41 | action, |
| 42 | ) |
| 43 | } |