Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Redox Scheme
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
redox-os
Redox Scheme
Commits
c0741452
Commit
c0741452
authored
3 weeks ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Add convenience fns for creating Response.
parent
ad9ef75f
No related branches found
No related tags found
2 merge requests
!6
Redesign API to fix (most) soundness and add async support.
,
!5
Draft: Improved async-capable interface
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib.rs
+18
-0
18 additions, 0 deletions
src/lib.rs
with
18 additions
and
0 deletions
src/lib.rs
+
18
−
0
View file @
c0741452
...
@@ -4,6 +4,7 @@ extern crate alloc;
...
@@ -4,6 +4,7 @@ extern crate alloc;
use
alloc
::
format
;
use
alloc
::
format
;
use
core
::
str
;
use
core
::
str
;
use
core
::
task
::
Poll
;
use
libredox
::
flag
;
use
libredox
::
flag
;
use
syscall
::
error
::{
Error
,
Result
,
EINTR
};
use
syscall
::
error
::{
Error
,
Result
,
EINTR
};
...
@@ -215,6 +216,23 @@ impl Socket {
...
@@ -215,6 +216,23 @@ impl Socket {
pub
struct
Response
(
Cqe
);
pub
struct
Response
(
Cqe
);
impl
Response
{
impl
Response
{
#[inline]
pub
fn
err
(
err
:
i32
,
req
:
impl
IntoTag
)
->
Self
{
Self
::
new
(
Err
(
Error
::
new
(
err
)),
req
)
}
#[inline]
pub
fn
ok
(
status
:
usize
,
req
:
impl
IntoTag
)
->
Self
{
Self
::
new
(
Ok
(
status
),
req
)
}
#[inline]
pub
fn
ready_ok
(
status
:
usize
,
req
:
impl
IntoTag
)
->
Poll
<
Self
>
{
Poll
::
Ready
(
Self
::
ok
(
status
,
req
))
}
#[inline]
pub
fn
ready_err
(
err
:
i32
,
req
:
impl
IntoTag
)
->
Poll
<
Self
>
{
Poll
::
Ready
(
Self
::
err
(
err
,
req
))
}
pub
fn
new
(
status
:
Result
<
usize
>
,
req
:
impl
IntoTag
)
->
Self
{
pub
fn
new
(
status
:
Result
<
usize
>
,
req
:
impl
IntoTag
)
->
Self
{
Self
(
Cqe
{
Self
(
Cqe
{
flags
:
CqeOpcode
::
RespondRegular
as
u8
,
flags
:
CqeOpcode
::
RespondRegular
as
u8
,
...
...
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