Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Commits
fbd9381e
Commit
fbd9381e
authored
6 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[ref] network: create SyncError
parent
c9adcb5c
No related branches found
No related tags found
1 merge request
!151
Resolve "Allow several network modules"
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/core/network/Cargo.toml
+1
-0
1 addition, 0 deletions
lib/core/network/Cargo.toml
lib/core/network/lib.rs
+19
-1
19 additions, 1 deletion
lib/core/network/lib.rs
lib/modules/ws2p/ws2p/src/lib.rs
+1
-1
1 addition, 1 deletion
lib/modules/ws2p/ws2p/src/lib.rs
with
21 additions
and
2 deletions
lib/core/network/Cargo.toml
+
1
−
0
View file @
fbd9381e
...
...
@@ -14,6 +14,7 @@ dup-crypto = { path = "../../tools/crypto" }
dubp-documents
=
{
path
=
"../../tools/documents"
}
durs-module
=
{
path
=
"../module"
}
durs-network-documents
=
{
path
=
"../../tools/network-documents"
}
failure
=
"0.1.5"
serde
=
"1.0.*"
serde_derive
=
"1.0.*"
serde_json
=
"1.0.*"
...
...
This diff is collapsed.
Click to expand it.
lib/core/network/lib.rs
+
19
−
1
View file @
fbd9381e
...
...
@@ -35,6 +35,7 @@ use durs_module::*;
use
durs_network_documents
::
network_endpoint
::
ApiFeatures
;
use
durs_network_documents
::
network_head
::
NetworkHead
;
use
durs_network_documents
::
*
;
use
failure
::
Fail
;
use
std
::
fmt
::
Debug
;
use
std
::
sync
::
mpsc
;
...
...
@@ -60,7 +61,7 @@ pub trait NetworkModule<DC: DursConfTrait, M: ModuleMessage>: ApiModule<DC, M> {
module_conf
:
<
Self
as
DursModule
<
DC
,
M
>>
::
ModuleConf
,
main_sender
:
mpsc
::
Sender
<
RouterThreadMessage
<
M
>>
,
sync_params
:
SyncOpt
,
)
->
Result
<
(),
ModuleInit
Error
>
;
)
->
Result
<
(),
Sync
Error
>
;
}
/// Trait to be implemented by the configuration object of the module managing the inter-node network.
...
...
@@ -74,3 +75,20 @@ pub enum NetworkConsensusError {
/// The network module does not determine consensus, there is most likely a fork
Fork
(),
}
#[derive(Debug,
Clone,
Fail,
PartialEq,
Eq,
Hash)]
/// Synchronization error
pub
enum
SyncError
{
/// Invalid source
#[fail(display
=
"invalid source: {}"
,
source)]
InvalidSource
{
/// Source
source
:
String
,
},
/// Unreachable source
#[fail(display
=
"unreachable source: {}"
,
source)]
UnreachableSource
{
/// Source
source
:
String
,
},
}
This diff is collapsed.
Click to expand it.
lib/modules/ws2p/ws2p/src/lib.rs
+
1
−
1
View file @
fbd9381e
...
...
@@ -130,7 +130,7 @@ impl NetworkModule<DuRsConf, DursMsg> for WS2PModule {
_conf
:
WS2PConf
,
_main_sender
:
mpsc
::
Sender
<
RouterThreadMessage
<
DursMsg
>>
,
_sync_params
:
SyncOpt
,
)
->
Result
<
(),
ModuleInit
Error
>
{
)
->
Result
<
(),
Sync
Error
>
{
unimplemented!
()
}
}
...
...
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