Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Arti
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jill
Arti
Commits
24dde5dd
Commit
24dde5dd
authored
2 years ago
by
Ian Jackson
Browse files
Options
Downloads
Patches
Plain Diff
prepare_send_from: clippy: Add missing docs
I intend to reintroduce this in its own MR.
parent
739e5b52
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crates/tor-basic-utils/src/futures.rs
+18
-11
18 additions, 11 deletions
crates/tor-basic-utils/src/futures.rs
with
18 additions
and
11 deletions
crates/tor-basic-utils/src/futures.rs
+
18
−
11
View file @
24dde5dd
...
...
@@ -259,20 +259,25 @@ where
#[pin_project]
#[must_use]
pub
struct
SinkPrepareSendFuture
<
'w
,
IF
,
OS
,
OM
>
{
///
#[pin]
generator
:
IF
,
// This Option exists because otherwise SinkPrepareSendFuture::poll()
// can't move `output` out of this struct to put it into the `SinkSendable`.
// (The poll() impl cannot borrow from SinkPrepareSendFuture.)
/// This Option exists because otherwise SinkPrepareSendFuture::poll()
/// can't move `output` out of this struct to put it into the `SinkSendable`.
/// (The poll() impl cannot borrow from SinkPrepareSendFuture.)
output
:
Option
<
Pin
<&
'w
mut
OS
>>
,
// `fn(OM)` gives contravariance in OM. Variance is confusing.
// Loosely, a SinkPrepareSendFuture<..OM> consumes an OM.
// Actually, we don't really need to add any variance restricions wrt OM,
// because the &mut OS already implies the correct variance,
// so we could have used the PhantomData<fn(*const OM)> trick.
// Happily there is no unsafe anywhere nearby, so it is not possible for us to write
// a bug due to getting the variance wrong - only to erroneously prevent some use
// case.
/// `fn(OM)` gives contravariance in OM.
///
/// Variance is confusing.
/// Loosely, a SinkPrepareSendFuture<..OM> consumes an OM.
/// Actually, we don't really need to add any variance restricions wrt OM,
/// because the &mut OS already implies the correct variance,
/// so we could have used the PhantomData<fn(*const OM)> trick.
/// Happily there is no unsafe anywhere nearby, so it is not possible for us to write
/// a bug due to getting the variance wrong - only to erroneously prevent some use
/// case.
tw
:
PhantomData
<
fn
(
OM
)
>
,
}
...
...
@@ -291,7 +296,9 @@ pub struct SinkPrepareSendFuture<'w, IF, OS, OM> {
/// encounter an error when producing the output message.
#[must_use]
pub
struct
SinkSendable
<
'w
,
OS
,
OM
>
{
///
output
:
Pin
<&
'w
mut
OS
>
,
///
tw
:
PhantomData
<
fn
(
OM
)
>
,
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment