Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
redoxfs
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
Container Registry
Model registry
Operate
Environments
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
redoxfs
Commits
856db3e2
Commit
856db3e2
authored
9 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Collection
parent
6d5be41c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/collection.rs
+30
-0
30 additions, 0 deletions
src/collection.rs
src/lib.rs
+2
-0
2 additions, 0 deletions
src/lib.rs
with
32 additions
and
0 deletions
src/collection.rs
0 → 100644
+
30
−
0
View file @
856db3e2
use
collections
::
Vec
;
use
system
::
error
::
Result
;
use
super
::{
ExNode
,
FileSystem
,
Node
};
/// A collection of a Node and its associated ExNodes
pub
struct
Collection
{
pub
node
:
(
u64
,
Node
),
pub
ex_nodes
:
Vec
<
(
u64
,
ExNode
)
>
}
impl
Collection
{
pub
fn
load
(
fs
:
&
mut
FileSystem
,
block
:
u64
)
->
Result
<
Collection
>
{
let
node
=
try
!
(
fs
.node
(
block
));
let
mut
next
=
node
.1
.next
;
let
mut
ex_nodes
=
Vec
::
new
();
while
next
>
0
{
let
ex_node
=
try
!
(
fs
.ex_node
(
next
));
next
=
ex_node
.1
.next
;
ex_nodes
.push
(
ex_node
);
}
Ok
(
Collection
{
node
:
node
,
ex_nodes
:
ex_nodes
,
})
}
}
This diff is collapsed.
Click to expand it.
src/lib.rs
+
2
−
0
View file @
856db3e2
...
...
@@ -15,6 +15,7 @@ extern crate collections;
extern
crate
system
;
pub
use
self
::
collection
::
Collection
;
pub
use
self
::
disk
::
Disk
;
pub
use
self
::
ex_node
::
ExNode
;
pub
use
self
::
extent
::
Extent
;
...
...
@@ -22,6 +23,7 @@ pub use self::filesystem::FileSystem;
pub
use
self
::
header
::
Header
;
pub
use
self
::
node
::
Node
;
pub
mod
collection
;
pub
mod
disk
;
pub
mod
ex_node
;
pub
mod
extent
;
...
...
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