Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
parity
Mirrored projects
polkadot-sdk
Commits
2b05b8ff
Commit
2b05b8ff
authored
7 years ago
by
Gav
Browse files
Options
Downloads
Patches
Plain Diff
Tweak docs
parent
e11f701c
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/environmental/src/lib.rs
+11
-10
11 additions, 10 deletions
substrate/environmental/src/lib.rs
with
11 additions
and
10 deletions
substrate/environmental/src/lib.rs
+
11
−
10
View file @
2b05b8ff
...
...
@@ -100,13 +100,13 @@ macro_rules! decl {
/// Declare a new global reference module whose underlying value does not contain references.
///
/// Will create a module of a given name that contains two functions:
///
-
`pub fn using<'a: 'b, 'b, R, F: FnOnce() -> R, T: 'a>(protected: &'b mut T, f: F) -> R`
///
*
`pub fn using<'a: 'b, 'b, R, F: FnOnce() -> R, T: 'a>(protected: &'b mut T, f: F) -> R`
/// This executes `f`, returning its value. During the call, the module's reference is set to
/// be equal to `protected`.
///
-
`pub fn with<R, F: for<'r, 't: 'r> FnOnce(&'r mut $t<'t>) -> R>(f: F) -> Option<R>`
/// This executes `f`, returning its value if called from code that is being executed
as part of
/// a `using` call.
The function takes one argument: the same reference as provided to the most
/// recent `using` call.
///
*
`pub fn with<R, F: for<'r, 't: 'r> FnOnce(&'r mut $t<'t>) -> R>(f: F) -> Option<R>`
/// This executes `f`, returning
`Some` of
its value if called from code that is being executed
///
as part of
a `using` call.
If not, it returns `None`. `f` is provided with one argument: the
///
same reference as provided to the most
recent `using` call.
///
/// # Examples
///
...
...
@@ -164,13 +164,14 @@ macro_rules! declare_simple {
/// Declare a new global reference module whose underlying value is generic over a reference.
///
/// Will create a module of a given name that contains two functions:
/// - `pub fn using<'a: 'b, 'b, R, F: FnOnce() -> R, T: 'a>(protected: &'b mut T, f: F) -> R`
///
/// * `pub fn using<'a: 'b, 'b, R, F: FnOnce() -> R, T: 'a>(protected: &'b mut T, f: F) -> R`
/// This executes `f`, returning its value. During the call, the module's reference is set to
/// be equal to `protected`.
///
-
`pub fn with<R, F: for<'r, 't: 'r> FnOnce(&'r mut $t<'t>) -> R>(f: F) -> Option<R>`
/// This executes `f`, returning its value if called from code that is being executed
as part of
/// a `using` call.
The function takes one argument: the same reference as provided to the most
/// recent `using` call.
///
*
`pub fn with<R, F: for<'r, 't: 'r> FnOnce(&'r mut $t<'t>) -> R>(f: F) -> Option<R>`
/// This executes `f`, returning
`Some` of
its value if called from code that is being executed
///
as part of
a `using` call.
If not, it returns `None`. `f` is provided with one argument: the
///
same reference as provided to the most
recent `using` call.
///
/// # Examples
///
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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