Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2572288
dump.rs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
905 B
Referenced Files
None
Subscribers
None
dump.rs
View Options
use
crate
::{
file
::{
self
,
Exists
},
helpers
,
log
,
process
::{
id
::
Id
,
Runner
},
};
use
colored
::
Colorize
;
use
global_placeholders
::
global
;
use
macros_rs
::{
crashln
,
string
};
use
std
::{
collections
::
BTreeMap
,
fs
};
pub
fn
read
()
->
Runner
{
if
!
Exists
::
file
(
global
!
(
"pmc.dump"
)).
unwrap
()
{
let
runner
=
Runner
{
id
:
Id
::
new
(
0
),
list
:
BTreeMap
::
new
(),
};
write
(
&
runner
);
log
!
(
"created dump file"
);
}
file
::
read_rmp
(
global
!
(
"pmc.dump"
))
}
pub
fn
write
(
dump
:
&
Runner
)
{
let
encoded
:
Vec
<
u8
>
=
match
rmp_serde
::
to_vec
(
&
dump
)
{
Ok
(
contents
)
=>
contents
,
Err
(
err
)
=>
crashln
!
(
"{} Cannot encode dump.
\n
{}"
,
*
helpers
::
FAIL
,
string
!
(
err
).
white
()),
};
if
let
Err
(
err
)
=
fs
::
write
(
global
!
(
"pmc.dump"
),
encoded
)
{
crashln
!
(
"{} Error writing dumpfile.
\n
{}"
,
*
helpers
::
FAIL
,
string
!
(
err
).
white
())
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 16, 9:36 AM (20 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
484930
Default Alt Text
dump.rs (905 B)
Attached To
Mode
rPMC Process Management Controller
Attached
Detach File
Event Timeline
Log In to Comment