pub struct UpdateGuard { /* private fields */ }Expand description
An exclusive hold on the writes of refs and config of one repository.
Repo::begin_update returns the guard. The guard holds the repository
lock shared and the update lock. The update lock is exclusive across
processes and inside the process.
The guard is a value: a caller holds it, passes it, and stores it. It is
Send + Sync.
The guard reads and writes refs, collection refs, and ref aliases. It
reads and writes config and the .conf files of the remotes directory.
It stages no object. Each write of the guard is atomic and visible when
the call returns.
§Remotes
The guard edits the remotes of config and of the .conf files of the
remotes directory, Repo::remotes_dir, as a read-modify-write of the
files on disk:
add_remoteset_remote_keyunset_remote_keyreplace_remotedelete_remote, which also removes the repository keyring of the remote
An add writes a new remote into the remotes directory if the handle has
one and [core] add-remotes-config-dir of config is not false. Else
it writes into config. Each other call edits the file that holds the
remote, so a remote stays in its file.
Each of these calls reads config and the remotes directory again, and
write_config reads the remotes directory
again. A .conf file that an open refuses, and that comes into the
directory after the open, makes each of these calls fail.
A write of a .conf file is atomic: the guard writes a temp file
.ostrya-tmp-<pid>-XXXXXX in the directory, whose name does not end in
.conf, and renames it over the file. With [core] fsync on, the write
syncs the file and the directory with fsync before the call returns. A
rewrite of a regular file keeps its permission bits, and does not keep
its owner. A rewrite of a .conf file that is a symlink replaces the link
with a regular file at the mode of a new file, and does not write through
the link: the target keeps its content.
The update lock is the lock of one repository. Two repositories that share one remotes directory do not exclude each other. Each write changes one entry of the directory, so a race of the two loses at most the edit of one file.
These calls and write_config run one at a
time on one guard.
§Writers that wait for the guard
A holder of the guard must write refs and config through the guard.
These writers wait for the guard:
Transaction::commitof a transaction that writes a ref or detached metadata, at the step that writes them. A pull and the transaction commit of a receive session wait at this step.Repo::set_ref_immediate,Repo::set_ref_alias_immediate, andRepo::remove_ref_alias_immediate.Repo::write_config,Repo::remove_remote_keyring, and, under theverify-gpgfeature,Repo::gpg_import_keys.Repo::regenerate_summary,Repo::regenerate_summaries,Repo::sign_summary,Repo::sign_summary_all, and thesummaryandsummary.sigwrites of a mirror pull.Repo::write_commit_detached_metadata,Repo::add_supplement,Repo::sign_commit, andRepo::delete_signatures.
If [core] locking is on, Repo::prune also waits for the guard,
because the guard holds the repository lock shared.
§A holder that waits for its own guard
No call detects a holder that waits for its own guard. This wait occurs if a task that holds the guard calls one of the writers that wait for the guard. It also occurs if that task waits for another task that calls one of these writers.
In both cases the wait lasts until [core] lock-timeout-secs passes. The
writer then fails with Error::LockTimeout. If lock-timeout-secs is
-1, the task waits forever.
§Release
finish releases the guard. A guard that drops
without finish runs the directory syncs of finish synchronously, on
the thread that drops the last reference to its state. It hides every
error and then releases both locks.
That thread is the thread that drops the guard, or the blocking-pool
thread of a write that still runs. The syncs block that thread, so an
async caller releases the guard with finish.
Implementations§
Source§impl UpdateGuard
impl UpdateGuard
Sourcepub async fn read_ref(&self, r: &Ref) -> Result<Option<Checksum>>
pub async fn read_ref(&self, r: &Ref) -> Result<Option<Checksum>>
Returns the commit that a ref names in the ref store.
The call reads the ref as Repo::resolve_ref_tip reads it. For a
collection ref of the [core] collection-id of the repository, the
call reads refs/heads/NAME, and it does not read
refs/mirrors/ID/. If the store holds the ref as an alias, the call
reads the ref that the alias names, by the alias rule of
Repo::resolve_ref_tip. A ref path that passes through a file holds
no ref. The result is None if the store holds no such ref.
§Errors
Error::InvalidRefspecif the ref failsRef::validate. The call reads no file.Error::NotARefif the ref path names a directory, a FIFO, a socket, or a device file, or an alias that breaks the alias rule.Error::InvalidFormatif the ref file is not UTF-8 or is larger than 4096 bytes, or if a component of the ref path is a symlink.Error::Coreif the ref file holds no checksum.Error::Ioif the read fails, for example on a ref file that the process cannot read.
Sourcepub async fn set_ref(&self, r: &Ref, checksum: Option<&Checksum>) -> Result<()>
pub async fn set_ref(&self, r: &Ref, checksum: Option<&Checksum>) -> Result<()>
Writes one ref atomically, as Repo::set_ref_immediate writes it.
The ref gives the path that Repo::set_ref_immediate writes:
refs/heads/NAME for a collection ref of the [core] collection-id
of the repository. If checksum is None, the call removes the ref
file. The ref is visible when the call returns. The sync of each
directory that changed waits for finish.
The id is the [core] collection-id that the open of the handle read.
After write_config sets a new id NEW,
the call writes @NEW:NAME to refs/mirrors/NEW/NAME until a new
open. The ref resolve, the collection ref listings, and the summary of
a new open ignore that file.
The call does not write or remove an alias. To remove an alias, use
remove_ref_alias.
§Errors
Error::InvalidRefspecif the ref failsRef::validate. The call writes nothing.Error::RefNotWritableif the path of the ref names an alias. The call writes nothing, and the alias stays. The call gives the same error, with the reasonpasses through an alias, ifrefsor a component above the ref is a symlink, also a dangling one. It then writes nothing through the symlink.Error::InvalidFormatif a file is at a directory component of the path, if a symlink is attmp, or if a writer puts a symlink at a component of the path after the check of the path. The call then writes nothing through the symlink.Error::Ioif a file system operation fails.
If a directory of refs/mirrors/ has a name that fails the rule, a
ref under it cannot be written or removed through this call. Remove
such a ref by hand.
Sourcepub async fn set_ref_alias(&self, alias: &Ref, target: &Ref) -> Result<()>
pub async fn set_ref_alias(&self, alias: &Ref, target: &Ref) -> Result<()>
Writes alias as an alias of target, as
Repo::set_ref_alias_immediate writes it.
The alias is a relative symlink. It replaces the entry that alias
named before. The call checks both refs, and the two refs do not have
to exist. An alias whose target is an alias is refused, as
Repo::set_ref_alias_immediate states.
Each ref gives its path as set_ref states:
refs/heads/NAME for a collection ref of the [core] collection-id,
and refs/mirrors/ID/NAME for a collection ref of each other id. The
id is the one that the open of the handle read, also after
write_config sets a new id. An error
names a ref by the text of its canonical form, as Ref::canonical
gives it.
§Errors
Error::InvalidRefspecifaliasortargetfailsRef::validate. The call checksaliasfirst.Error::RefNotWritableifrefsor a component above the path ofaliasis a symlink, also a dangling one. The reason ispasses through an alias, and the call writes nothing.Error::RefNotWritableforaliasiftargetnames an alias or the path ofaliasitself (reasontargets an alias), or ifrefsor a component above the path oftargetis a symlink (reasonpasses through an alias). The call writes nothing.Error::InvalidFormatif a file is at a directory component of the path, if a symlink is attmp, or if a writer puts a symlink at a component of the path after the check of the path. The call then writes nothing through the symlink.Error::Ioif a file system operation fails.
Sourcepub async fn remove_ref_alias(&self, alias: &Ref) -> Result<()>
pub async fn remove_ref_alias(&self, alias: &Ref) -> Result<()>
Removes the alias alias, as Repo::remove_ref_alias_immediate
removes it.
The ref gives the path as set_ref_alias
states. The ref that the alias names stays. The removal of an absent
path is not an error. The sync of the directory that held the link
waits for finish.
§Errors
Error::InvalidRefspecifaliasfailsRef::validate.Error::RefNotWritableif the path ofaliasnames a ref file, names a directory, passes through a file or an alias, or names a special file. The call removes nothing.Error::Ioif a file system operation fails.
Sourcepub async fn read_config(&self) -> Result<RepoConfig>
pub async fn read_config(&self) -> Result<RepoConfig>
Reads the config file and the .conf files of the remotes directory
of the handle from disk and parses them.
The repository handle keeps the config that it read at open. A
read-modify-write of config under the guard reads the file with this
call. The call reads the directory of
Repo::remotes_dir, and does not read the
key [ex-ostrya] remotes-config-dir again.
§Errors
Error::Ioof kindNotFoundifconfigdoes not exist.Error::InvalidFormatifconfigis a symlink, is not a regular file, is larger than 1 MiB (1048576 bytes), or is not UTF-8.- An error of
RepoConfig::parseifconfigdoes not parse. Error::Ioif the read fails.- The errors of
OpenOptions::openfor the remotes directory and its.conffiles.
Sourcepub async fn write_config(&self, keyfile: &KeyFile) -> Result<()>
pub async fn write_config(&self, keyfile: &KeyFile) -> Result<()>
Replaces config with the document that keyfile holds.
The call writes the file as Repo::write_config writes it. The new
file is visible when the call returns. The sync of the repository
directory waits for finish.
The call writes the document as given. The repository handle and the
guard keep the values that they read before. A new open of the
repository reads the new values. This also applies to [core] collection-id, as set_ref states. The write
does not interleave with a remote call of the same guard.
The call refuses a document with a [remote "NAME"] group when a
.conf file of the remotes directory defines NAME, as
Repo::write_config does. It reads the directory again for this
check.
§Errors
Error::InvalidFormatif the document is larger than 1 MiB, the size that an open accepts. The call then writes nothing.Error::RemoteExistsif the document has a group of a remote of the remotes directory. The call then writes nothing.- The errors of
OpenOptions::openfor the remotes directory and its.conffiles. Error::InvalidFormatiftmportmp/cacheis a symlink or is not a directory. The write ofconfigmakes its temp file intmp/.Error::Ioif a file system operation fails.
Sourcepub async fn add_remote(&self, name: &str, keys: &[(&str, &str)]) -> Result<()>
pub async fn add_remote(&self, name: &str, keys: &[(&str, &str)]) -> Result<()>
Adds the remote name, with the keys of keys in order.
If the handle has a remotes directory and [core] add-remotes-config-dir of config is not false, the call writes
the file <name>.conf into the directory. The file holds the one
group [remote "<name>"]. Its mode is 0666 with the umask applied.
If the directory is absent, the call creates it and each absent
parent, at mode 0777 with the umask applied. In a
bare-user-shared repository, each directory that the call creates
for an InRepo value gets the mode
02770. The call refuses the name if the directory holds an entry
<name>.conf of any type, also a symlink. The check and the write are
one step: the move of the temp file to <name>.conf does not replace
an entry.
Else the [remote "<name>"] group goes at the end of config. The
call does not touch a trusted keyring of the name. A refusal writes
nothing.
The call reads config and the remotes directory from disk, edits
the target, and writes it in one step on the blocking pool. It writes
config as write_config does:
atomically, with the sync of the repository directory left to
finish. It writes a .conf file as
UpdateGuard states in “Remotes”. Repo::config keeps the copy
that the handle read at open.
The rewrite of config keeps the groups and keys of the file in their
order. It drops the comment lines and the blank lines of the file.
The remote calls and write_config of one
guard run one at a time, so concurrent calls on one guard lose no edit.
If the future of a call drops after its first poll, the call makes the
whole edit or none of it. An edit that runs completes, and finish
waits for it.
§Errors
Error::InvalidInputifvalid_remote_namerefusesname, ifkeysis empty, or if a key file cannot hold a key name ofkeys.Error::RemoteExistsifconfigor a.conffile has a remote of that name.Error::Ioof the kindAlreadyExistsif the call writes into the remotes directory and the directory holds an entry<name>.conf. The message starts with the path of the entry.Error::Coreif[core] add-remotes-config-diris not a boolean. The call reads the key only for a handle with a remotes directory.- The errors of
read_config. Error::InvalidFormatif the new file is larger than 1 MiB.Error::Ioif a file system operation fails.
Sourcepub async fn set_remote_key(
&self,
name: &str,
key: &str,
value: &str,
) -> Result<()>
pub async fn set_remote_key( &self, name: &str, key: &str, value: &str, ) -> Result<()>
Sets the key key of the remote name to value, in the file that
holds the remote: config or a .conf file of the remotes directory.
A key that exists keeps its position. A new key goes at the end of the
group. If the key holds value already, the call writes nothing.
The call reads the files and writes config as
add_remote does. A rewrite of a .conf
file keeps the other groups of the file and the groups and keys in
their order, and drops the comment lines and the blank lines. A
refusal writes nothing.
§Errors
Error::RemoteNotFoundif no source holds the remote.Error::InvalidInputif a key file cannot hold the key name.- The errors of
read_config. Error::InvalidFormatif the new file is larger than 1 MiB.Error::Ioif a file system operation fails.
Sourcepub async fn unset_remote_key(&self, name: &str, key: &str) -> Result<bool>
pub async fn unset_remote_key(&self, name: &str, key: &str) -> Result<bool>
Removes the key key of the remote name from the file that holds
the remote.
The call returns true if it removed the key. If the key is absent,
the call returns false and writes nothing. The group stays, also when
it has no key left.
The call reads and writes the files as
set_remote_key does.
§Errors
Error::RemoteNotFoundif no source holds the remote. The call then writes nothing.- The errors of
read_config. Error::InvalidFormatif the new file is larger than 1 MiB.Error::Ioif a file system operation fails.
Sourcepub async fn replace_remote(
&self,
name: &str,
keys: &[(&str, &str)],
) -> Result<()>
pub async fn replace_remote( &self, name: &str, keys: &[(&str, &str)], ) -> Result<()>
Replaces the remote name with a remote of the keys of keys, in
order, in the file that holds it.
The call removes the [remote "<name>"] group from its source,
config or a .conf file of the remotes directory, and writes a new
group with keys at the end of the same source. The other groups of
the source stay. The call does not touch a trusted keyring of the
name. A refusal writes nothing.
The call reads and writes the source as
set_remote_key does.
§Errors
Error::InvalidInputifvalid_remote_namerefusesname, ifkeysis empty, or if a key file cannot hold a key name ofkeys.Error::RemoteNotFoundif no source holds the remote.- The errors of
read_config. Error::InvalidFormatif the new file is larger than 1 MiB.Error::Ioif a file system operation fails.
Sourcepub async fn delete_remote(&self, name: &str) -> Result<()>
pub async fn delete_remote(&self, name: &str) -> Result<()>
Deletes the remote name from the file that holds it, together with
its repository keyring.
The call removes the trusted keyring <name>.trustedkeys.gpg at the
repository root, and then the group of the remote from its file. For a
symlink at the keyring, it removes the link, and the target stays. An
absent keyring is not an error. A keyring name that is too long for the
file system is not an error, because no file can have that name. The
call does not remove a keyring of the remotes directory.
In a .conf file of the remotes directory, the call removes the group.
If the file then holds no [remote "NAME"] group, the call removes the
file, together with each other group of it. For a symlink, it removes
the link, and the target stays. Else it writes the file back, as
set_remote_key does.
The repository keyring goes with the remote. A keyring of the remotes
directory stays, as the ostree command keeps it. A later remote of the
same name trusts the keys of that keyring while the repository holds no
keyring of that name. The repository keyring goes first, so a failure
between the two steps can leave a remote with no repository keyring. It
cannot leave a repository keyring with no remote.
The removal is visible when the call returns. The sync of the
repository directory waits for finish. The
call reads the files and writes config as
add_remote does. A refusal removes no
file and writes nothing.
§Errors
Error::InvalidInputifvalid_remote_namerefusesname.Error::RemoteNotFoundif no source holds the remote.- The errors of
read_config. Error::InvalidFormatif the new file is larger than 1 MiB.Error::Ioif the removal of the keyring or the write of the file fails.
Sourcepub async fn finish(self) -> Result<()>
pub async fn finish(self) -> Result<()>
Syncs the directories that the writes changed, and releases both locks.
The call first waits until each write of the guard ends. It then runs
fsync once on each directory that a write changed, deepest first. It
then releases the update lock and the repository lock. If [core] fsync is off, the guard records no directory, and the call runs no
sync.
The wait covers a write whose future was dropped while its work on the blocking pool still ran. That work ends before the syncs start, so the call syncs the directories of each write of the guard. Both locks are free when the call returns.
The call runs each sync, also after a sync that fails. The release of the locks comes after the syncs, also if the returned future drops before it completes.
§Errors
Error::Ioif a sync fails. The call returns the error of the first sync that fails.
Trait Implementations§
Auto Trait Implementations§
impl Forget for UpdateGuard
impl Freeze for UpdateGuard
impl Move for UpdateGuard
impl RefUnwindSafe for UpdateGuard
impl Send for UpdateGuard
impl Sync for UpdateGuard
impl Unpin for UpdateGuard
impl UnsafeUnpin for UpdateGuard
impl UnwindSafe for UpdateGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.