Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LCMS2 Rust Wrapper
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
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
Eduardo Trujillo
LCMS2 Rust Wrapper
Commits
c5639a4a
Commit
c5639a4a
authored
4 years ago
by
Kornel Lesiński
Browse files
Options
Downloads
Patches
Plain Diff
AssertUnwindSafe and Arc/Rc wrappers
parent
832dc9a4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/context.rs
+19
-0
19 additions, 0 deletions
src/context.rs
with
19 additions
and
0 deletions
src/context.rs
+
19
−
0
View file @
c5639a4a
use
std
::
rc
::
Rc
;
use
std
::
sync
::
Arc
;
use
super
::
*
;
use
std
::
ptr
;
use
std
::
mem
;
...
...
@@ -19,6 +21,9 @@ pub struct GlobalContext {
impl
UnwindSafe
for
GlobalContext
{}
impl
RefUnwindSafe
for
GlobalContext
{}
impl
UnwindSafe
for
ThreadContext
{}
impl
RefUnwindSafe
for
ThreadContext
{}
#[doc(hidden)]
pub
trait
Context
{
fn
as_ptr
(
&
self
)
->
ffi
::
Context
;
...
...
@@ -50,6 +55,20 @@ impl<'a> Context for &'a ThreadContext {
}
}
impl
<
'a
>
Context
for
Arc
<
ThreadContext
>
{
#[inline]
fn
as_ptr
(
&
self
)
->
ffi
::
Context
{
self
.handle
}
}
impl
<
'a
>
Context
for
Rc
<
ThreadContext
>
{
#[inline]
fn
as_ptr
(
&
self
)
->
ffi
::
Context
{
self
.handle
}
}
impl
Context
for
ThreadContext
{
#[inline]
fn
as_ptr
(
&
self
)
->
ffi
::
Context
{
...
...
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