Struct radicle_surf::vcs::Browser [−][src]
pub struct Browser<Repo, A, Error> { /* fields omitted */ }
A Browser
is a way of rendering a History
into a
Directory
snapshot, and the current History
it is
viewing.
Implementations
impl<'a> Browser<RepositoryRef<'a>, Commit, Error>
[src]
impl<'a> Browser<RepositoryRef<'a>, Commit, Error>
[src]pub fn new(
repository: impl Into<RepositoryRef<'a>>,
rev: impl Into<Rev>
) -> Result<Self, Error>
[src]
repository: impl Into<RepositoryRef<'a>>,
rev: impl Into<Rev>
) -> Result<Self, Error>
Create a new browser to interact with.
The revspec
provided will be used to kick off the History
for this
Browser
.
Errors
Examples
use radicle_surf::vcs::git::{Browser, Branch, Repository}; let repo = Repository::new("./data/git-platinum")?; let browser = Browser::new(&repo, Branch::local("master"))?;
pub fn new_with_namespace(
repository: impl Into<RepositoryRef<'a>>,
namespace: &Namespace,
rev: impl Into<Rev>
) -> Result<Self, Error>
[src]
repository: impl Into<RepositoryRef<'a>>,
namespace: &Namespace,
rev: impl Into<Rev>
) -> Result<Self, Error>
Create a new Browser
that starts in a given namespace
.
Errors
Examples
use radicle_surf::vcs::git::{Browser, Repository, Branch, BranchSelector, BranchName, Namespace}; use std::convert::TryFrom; let repo = Repository::new("./data/git-platinum")?; let browser = Browser::new_with_namespace( &repo, &Namespace::try_from("golden")?, Branch::local("master") )?; let mut branches = browser.list_branches(BranchSelector::Local)?; branches.sort(); assert_eq!( branches, vec![ Branch::local("banana"), Branch::local("master"), ] );
pub fn switch_namespace(
self,
namespace: &Namespace,
rev: impl Into<Ref>
) -> Result<Self, Error>
[src]
self,
namespace: &Namespace,
rev: impl Into<Ref>
) -> Result<Self, Error>
Switch the namespace you are browsing in. This will consume the previous
Browser
and give you back a new Browser
for that particular
namespace. The revision
provided will kick-off the history for
this Browser
.
pub fn which_namespace(&self) -> Result<Option<Namespace>, Error>
[src]
What is the current namespace we’re browsing in.
pub fn head(&mut self) -> Result<(), Error>
[src]
Set the current Browser
history to the HEAD
commit of the underlying
repository.
Errors
Examples
use radicle_surf::vcs::git::{Browser, Repository, Branch}; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; // ensure we're at HEAD browser.head(); let directory = browser.get_directory(); // We are able to render the directory assert!(directory.is_ok());
pub fn branch(&mut self, branch: Branch) -> Result<(), Error>
[src]
Set the current Browser
’s History
to the given BranchName
provided.
Errors
Examples
use radicle_surf::vcs::git::{Branch, Browser, Repository}; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; // ensure we're on 'master' browser.branch(Branch::local("master")); let directory = browser.get_directory(); // We are able to render the directory assert!(directory.is_ok());
use radicle_surf::vcs::git::{Branch, Browser, Repository}; use radicle_surf::file_system::{Label, Path, SystemType}; use radicle_surf::file_system::unsound; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; browser.branch(Branch::remote("dev", "origin"))?; let directory = browser.get_directory()?; let mut directory_contents = directory.list_directory(); directory_contents.sort(); assert!(directory_contents.contains( &SystemType::file(unsound::label::new("here-we-are-on-a-dev-branch.lol")) ));
pub fn tag(&mut self, tag_name: TagName) -> Result<(), Error>
[src]
Set the current Browser
’s History
to the TagName
provided.
Errors
Examples
use nonempty::NonEmpty; use radicle_surf::vcs::History; use radicle_surf::vcs::git::{TagName, Branch, Browser, Oid, Repository}; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; // Switch to "v0.3.0" browser.tag(TagName::new("v0.3.0"))?; let expected_history = History(NonEmpty::from(( Oid::from_str("19bec071db6474af89c866a1bd0e4b1ff76e2b97")?, vec![ Oid::from_str("f3a089488f4cfd1a240a9c01b3fcc4c34a4e97b2")?, Oid::from_str("2429f097664f9af0c5b7b389ab998b2199ffa977")?, Oid::from_str("d3464e33d75c75c99bfb90fa2e9d16efc0b7d0e3")?, ] ))); let history_ids = browser.get().map(|commit| commit.id); // We are able to render the directory assert_eq!(history_ids, expected_history);
pub fn commit(&mut self, oid: Oid) -> Result<(), Error>
[src]
Set the current Browser
’s History
to the Oid
(SHA digest)
provided.
Errors
Examples
use radicle_surf::file_system::{Label, SystemType}; use radicle_surf::file_system::unsound; use radicle_surf::vcs::git::{Branch, Browser, Oid, Repository}; use std::str::FromStr; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; // Set to the initial commit let commit = Oid::from_str("e24124b7538658220b5aaf3b6ef53758f0a106dc")?; browser.commit(commit)?; let directory = browser.get_directory()?; let mut directory_contents = directory.list_directory(); assert_eq!( directory_contents, vec![ SystemType::file(unsound::label::new("README.md")), SystemType::directory(unsound::label::new("bin")), SystemType::directory(unsound::label::new("src")), SystemType::directory(unsound::label::new("this")), ] );
pub fn rev(&mut self, rev: impl Into<Rev>) -> Result<(), Error>
[src]
Set a Browser
’s History
based on a revspec.
Errors
Examples
use radicle_surf::file_system::{Label, SystemType}; use radicle_surf::file_system::unsound; use radicle_surf::vcs::git::{Browser, Branch, Oid, Repository}; use std::str::FromStr; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; browser.rev(Branch::remote("dev", "origin"))?; let directory = browser.get_directory()?; let mut directory_contents = directory.list_directory(); directory_contents.sort(); assert!(directory_contents.contains( &SystemType::file(unsound::label::new("here-we-are-on-a-dev-branch.lol")) ));
pub fn oid(&self, oid: &str) -> Result<Oid, Error>
[src]
Parse an Oid
from the given string. This is useful if we have a
shorthand version of the Oid
, as opposed to the full one.
Examples
use radicle_surf::vcs::git::{Branch, Browser, Oid, Repository}; use std::str::FromStr; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; // Set to the initial commit let commit = Oid::from_str("e24124b7538658220b5aaf3b6ef53758f0a106dc")?; assert_eq!( commit, browser.oid("e24124b")?, );
pub fn diff(&self, from: Oid, to: Oid) -> Result<Diff, Error>
[src]
Get the Diff
between two commits.
pub fn initial_diff(&self, oid: Oid) -> Result<Diff, Error>
[src]
Get the Diff
of a commit with no parents.
pub fn list_branches(
&self,
filter: BranchSelector
) -> Result<Vec<Branch>, Error>
[src]
&self,
filter: BranchSelector
) -> Result<Vec<Branch>, Error>
List the names of the branches that are contained in the underlying
Repository
.
Errors
Examples
use radicle_surf::vcs::git::{Branch, BranchSelector, BranchName, Browser, Namespace, Repository}; use std::convert::TryFrom; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; let branches = browser.list_branches(BranchSelector::All)?; // 'master' exists in the list of branches assert!(branches.contains(&Branch::local("master"))); // Filter the branches by `Remote` 'origin'. let mut branches = browser.list_branches(BranchSelector::Remote { name: Some("origin".to_string()) })?; branches.sort(); assert_eq!(branches, vec![ Branch::remote("HEAD", "origin"), Branch::remote("dev", "origin"), Branch::remote("master", "origin"), ]); // Filter the branches by all `Remote`s. let mut branches = browser.list_branches(BranchSelector::Remote { name: None })?; branches.sort(); assert_eq!(branches, vec![ Branch::remote("HEAD", "origin"), Branch::remote("dev", "origin"), Branch::remote("master", "origin"), Branch::remote("pineapple", "banana"), ]); // We can also switch namespaces and list the branches in that namespace. let golden = browser.switch_namespace(&Namespace::try_from("golden")?, Branch::local("master"))?; let mut branches = golden.list_branches(BranchSelector::Local)?; branches.sort(); assert_eq!(branches, vec![ Branch::local("banana"), Branch::local("master"), ]);
pub fn list_tags(&self) -> Result<Vec<Tag>, Error>
[src]
List the names of the tags that are contained in the underlying
Repository
.
Errors
Examples
use radicle_surf::vcs::git::{Branch, Browser, Namespace, Oid, Repository, Tag, TagName}; use std::convert::TryFrom; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; let tags = browser.list_tags()?; assert_eq!( tags, vec![ Tag::Light { id: Oid::from_str("d3464e33d75c75c99bfb90fa2e9d16efc0b7d0e3")?, name: TagName::new("v0.1.0"), }, Tag::Light { id: Oid::from_str("2429f097664f9af0c5b7b389ab998b2199ffa977")?, name: TagName::new("v0.2.0") }, Tag::Light { id: Oid::from_str("19bec071db6474af89c866a1bd0e4b1ff76e2b97")?, name: TagName::new("v0.3.0") }, Tag::Light { id: Oid::from_str("91b69e00cd8e5a07e20942e9e4457d83ce7a3ff1")?, name: TagName::new("v0.4.0") }, Tag::Light { id: Oid::from_str("80ded66281a4de2889cc07293a8f10947c6d57fe")?, name: TagName::new("v0.5.0") }, ] ); // We can also switch namespaces and list the branches in that namespace. let golden = browser.switch_namespace(&Namespace::try_from("golden")?, Branch::local("master"))?; let branches = golden.list_tags()?; assert_eq!(branches, vec![ Tag::Light { id: Oid::from_str("d3464e33d75c75c99bfb90fa2e9d16efc0b7d0e3")?, name: TagName::new("v0.1.0"), }, Tag::Light { id: Oid::from_str("2429f097664f9af0c5b7b389ab998b2199ffa977")?, name: TagName::new("v0.2.0") }, ]);
pub fn list_namespaces(&self) -> Result<Vec<Namespace>, Error>
[src]
List the namespaces within a Browser
, filtering out ones that do not
parse correctly.
Errors
Examples
use radicle_surf::vcs::git::{Branch, BranchType, BranchName, Browser, Namespace, Repository}; use std::convert::TryFrom; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; let mut namespaces = browser.list_namespaces()?; namespaces.sort(); assert_eq!(namespaces, vec![ Namespace::try_from("golden")?, Namespace::try_from("golden/silver")?, Namespace::try_from("me")?, ]);
pub fn last_commit(&self, path: Path) -> Result<Option<Commit>, Error>
[src]
Given a crate::file_system::Path
to a file, return the last
Commit
that touched that file or directory.
Errors
Examples
use radicle_surf::vcs::git::{Branch, Browser, Oid, Repository}; use radicle_surf::file_system::{Label, Path, SystemType}; use radicle_surf::file_system::unsound; use std::str::FromStr; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; // Clamp the Browser to a particular commit let commit = Oid::from_str("d6880352fc7fda8f521ae9b7357668b17bb5bad5")?; browser.commit(commit)?; let head_commit = browser.get().first().clone(); let expected_commit = Oid::from_str("d3464e33d75c75c99bfb90fa2e9d16efc0b7d0e3")?; let readme_last_commit = browser .last_commit(Path::with_root(&[unsound::label::new("README.md")]))? .map(|commit| commit.id); assert_eq!(readme_last_commit, Some(expected_commit)); let expected_commit = Oid::from_str("e24124b7538658220b5aaf3b6ef53758f0a106dc")?; let memory_last_commit = browser .last_commit(Path::with_root(&[unsound::label::new("src"), unsound::label::new("memory.rs")]))? .map(|commit| commit.id); assert_eq!(memory_last_commit, Some(expected_commit));
pub fn file_history(&self, path: Path) -> Result<Vec<Commit>, Error>
[src]
Get the commit history for a file or directory.
Examples
use nonempty::NonEmpty; use radicle_surf::vcs::git::{Branch, Browser, Oid, Repository}; use radicle_surf::file_system::{Label, Path, SystemType}; use radicle_surf::file_system::unsound; use std::str::FromStr; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; // Clamp the Browser to a particular commit let commit = Oid::from_str("223aaf87d6ea62eef0014857640fd7c8dd0f80b5")?; browser.commit(commit)?; let root_commits: Vec<Oid> = browser .file_history(unsound::path::new("~"))? .into_iter() .map(|commit| commit.id) .collect(); assert_eq!(root_commits, vec![ Oid::from_str("223aaf87d6ea62eef0014857640fd7c8dd0f80b5")?, Oid::from_str("80bacafba303bf0cdf6142921f430ff265f25095")?, Oid::from_str("a57846bbc8ced6587bf8329fc4bce970eb7b757e")?, Oid::from_str("3873745c8f6ffb45c990eb23b491d4b4b6182f95")?, Oid::from_str("80ded66281a4de2889cc07293a8f10947c6d57fe")?, Oid::from_str("91b69e00cd8e5a07e20942e9e4457d83ce7a3ff1")?, Oid::from_str("1820cb07c1a890016ca5578aa652fd4d4c38967e")?, Oid::from_str("1e0206da8571ca71c51c91154e2fee376e09b4e7")?, Oid::from_str("e24124b7538658220b5aaf3b6ef53758f0a106dc")?, Oid::from_str("19bec071db6474af89c866a1bd0e4b1ff76e2b97")?, Oid::from_str("f3a089488f4cfd1a240a9c01b3fcc4c34a4e97b2")?, Oid::from_str("2429f097664f9af0c5b7b389ab998b2199ffa977")?, Oid::from_str("d3464e33d75c75c99bfb90fa2e9d16efc0b7d0e3")?, ] ); let eval_commits: Vec<Oid> = browser .file_history(unsound::path::new("~/src/Eval.hs"))? .into_iter() .map(|commit| commit.id) .collect(); assert_eq!(eval_commits, vec![ Oid::from_str("3873745c8f6ffb45c990eb23b491d4b4b6182f95")?, Oid::from_str("e24124b7538658220b5aaf3b6ef53758f0a106dc")?, ] );
pub fn extract_signature(
&self,
commit: &Commit,
field: Option<&str>
) -> Result<Option<Signature>, Error>
[src]
&self,
commit: &Commit,
field: Option<&str>
) -> Result<Option<Signature>, Error>
Extract the signature for a commit
Arguments
commit
- The commit to extract the signature forfield
- the name of the header field containing the signature block; passNone
to extract the default ‘gpgsig’
Examples
use radicle_surf::vcs::git::{Branch, Browser, Repository, Oid, error}; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; let commit_with_signature_oid = Oid::from_str( "e24124b7538658220b5aaf3b6ef53758f0a106dc" )?; browser.commit(commit_with_signature_oid)?; let history = browser.get(); let commit_with_signature = history.first(); let signature = browser.extract_signature(commit_with_signature, None)?; // We have a signature assert!(signature.is_some()); let commit_without_signature_oid = Oid::from_str( "80bacafba303bf0cdf6142921f430ff265f25095" )?; browser.commit(commit_without_signature_oid)?; let history = browser.get(); let commit_without_signature = history.first(); let signature = browser.extract_signature(commit_without_signature, None)?; // There is no signature assert!(signature.is_none());
pub fn revision_branches(
&self,
rev: impl Into<Rev>
) -> Result<Vec<Branch>, Error>
[src]
&self,
rev: impl Into<Rev>
) -> Result<Vec<Branch>, Error>
List the Branch
es, which contain the provided Commit
.
Errors
Examples
use radicle_surf::vcs::git::{Browser, Repository, Branch, BranchName, Namespace, Oid}; use std::convert::TryFrom; let repo = Repository::new("./data/git-platinum")?; let browser = Browser::new(&repo, Branch::local("master"))?; let branches = browser.revision_branches(Oid::from_str("27acd68c7504755aa11023300890bb85bbd69d45")?)?; assert_eq!( branches, vec![ Branch::local("dev"), Branch::remote("dev", "origin"), ] ); // TODO(finto): I worry that this test will fail as other branches get added let mut branches = browser.revision_branches(Oid::from_str("1820cb07c1a890016ca5578aa652fd4d4c38967e")?)?; branches.sort(); assert_eq!( branches, vec![ Branch::remote("HEAD", "origin"), Branch::local("dev"), Branch::remote("dev", "origin"), Branch::local("master"), Branch::remote("master", "origin"), Branch::remote("pineapple", "banana"), ] ); let golden_browser = browser.switch_namespace(&Namespace::try_from("golden")?, Branch::local("master"))?; let branches = golden_browser.revision_branches(Oid::from_str("27acd68c7504755aa11023300890bb85bbd69d45")?)?; assert_eq!( branches, vec![ Branch::local("banana"), Branch::remote("fakie/bigspin", "kickflip"), Branch::remote("heelflip", "kickflip"), ] );
pub fn get_stats(&self) -> Result<Stats, Error>
[src]
Get the Stats
of the underlying Repository
.
Errors
Examples
use radicle_surf::vcs::git::{Branch, Browser, Repository}; let repo = Repository::new("./data/git-platinum")?; let mut browser = Browser::new(&repo, Branch::local("master"))?; let stats = browser.get_stats()?; assert_eq!(stats.branches, 2); assert_eq!(stats.commits, 15); assert_eq!(stats.contributors, 4);
impl<Repo, A, Error> Browser<Repo, A, Error>
[src]
impl<Repo, A, Error> Browser<Repo, A, Error>
[src]pub fn get(&self) -> History<A> where
A: Clone,
[src]
A: Clone,
Get the current History
the Browser
is viewing.
pub fn set(&mut self, history: History<A>)
[src]
Set the History
the Browser
should view.
pub fn get_directory(&self) -> Result<Directory, Error>
[src]
Render the Directory
for this Browser
.
pub fn modify<F>(&mut self, f: F) where
F: Fn(&History<A>) -> History<A>,
[src]
F: Fn(&History<A>) -> History<A>,
Modify the History
in this Browser
.
pub fn view_at<F>(&mut self, default_history: History<A>, f: F) where
A: Clone,
F: Fn(&History<A>) -> Option<History<A>>,
[src]
A: Clone,
F: Fn(&History<A>) -> Option<History<A>>,
Change the Browser
’s view of History
by modifying it, or
using the default History
provided if the operation fails.
Trait Implementations
impl<Repo, A, Error> VCS<A, Error> for Browser<Repo, A, Error> where
Repo: VCS<A, Error>,
[src]
impl<Repo, A, Error> VCS<A, Error> for Browser<Repo, A, Error> where
Repo: VCS<A, Error>,
[src]type HistoryId = Repo::HistoryId
The way to identify a History.
type ArtefactId = Repo::ArtefactId
The way to identify an artefact.
fn get_history(&self, identifier: Self::HistoryId) -> Result<History<A>, Error>
[src]
fn get_histories(&self) -> Result<Vec<History<A>>, Error>
[src]
fn get_identifier(artifact: &A) -> Self::ArtefactId
[src]
Auto Trait Implementations
impl<Repo, A, Error> !RefUnwindSafe for Browser<Repo, A, Error>
impl<Repo, A, Error> !RefUnwindSafe for Browser<Repo, A, Error>
impl<Repo, A, Error> !UnwindSafe for Browser<Repo, A, Error>
impl<Repo, A, Error> !UnwindSafe for Browser<Repo, A, Error>
Blanket Implementations
impl<T> FmtForward for T
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
pub fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_ref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
pub fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
pub fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
pub fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_as_mut<'a, U, R>(
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
pub fn pipe_deref_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
R: 'a,
impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
pub fn pipe_as_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
pub fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
impl<T> PipeDeref for T
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
impl<T> Tap for T
impl<T> Tap for T
pub fn tap(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
pub fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
impl<T> TapDeref for T
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,