Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894986
mod.rs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
782 B
Referenced Files
None
Subscribers
None
mod.rs
View Options
use
rusqlite
::
Connection
;
use
serde_json
::
Value
;
use
ulid
::
Ulid
;
pub
struct
Label
{
pub
key
:
String
,
pub
val
:
Option
<
String
>
,
}
impl
Label
{
pub
fn
new
(
key
:
String
,
val
:
Option
<
String
>
)
->
Self
{
Self
{
key
,
val
}
}
}
pub
struct
Edge
{
pub
id
:
usize
,
pub
name
:
String
,
pub
data
:
Option
<
Value
>
,
pub
nodes
:
Vec
<
Ulid
>
,
}
impl
Edge
{
pub
fn
new
(
name
:
&
str
,
sqlite
:
&
Connection
)
->
Edge
{
let
id
:
usize
=
sqlite
.
query_row
(
"INSERT into edges (name) values(?1) returning id"
,
[
name
],
|
row
|
row
.
get
(
0
),
)
.
unwrap
();
Edge
{
id
,
name
:
name
.
into
(),
data
:
None
,
nodes
:
vec
!
[],
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jan 19 2025, 20:47 (6 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1120199
Default Alt Text
mod.rs (782 B)
Attached To
Mode
R4 Rust Conduit Client
Attached
Detach File
Event Timeline
Log In to Comment