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
11313075
Commit
11313075
authored
7 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[enh]
#68
add message crate
parent
bebb7c10
No related branches found
No related tags found
1 merge request
!58
Resolve "Add crates blockchain, conf, core, dal, message, module, network, tui and ws2p"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
message/Cargo.toml
+19
-0
19 additions, 0 deletions
message/Cargo.toml
message/lib.rs
+75
-0
75 additions, 0 deletions
message/lib.rs
with
94 additions
and
0 deletions
message/Cargo.toml
0 → 100644
+
19
−
0
View file @
11313075
[package]
name
=
"duniter-message"
version
=
"0.1.0"
authors
=
[
"librelois <elois@duniter.org>"
]
description
=
"message model for the Duniter project."
license
=
"AGPL-3.0"
[lib]
path
=
"lib.rs"
[dependencies]
duniter-crypto
=
{
path
=
"../crypto"
}
duniter-dal
=
{
path
=
"../dal"
}
duniter-documents
=
{
path
=
"../documents"
}
duniter-module
=
{
path
=
"../module"
}
duniter-network
=
{
path
=
"../network"
}
serde
=
"1.0.24"
serde_derive
=
"1.0.24"
serde_json
=
"1.0.9"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
message/lib.rs
0 → 100644
+
75
−
0
View file @
11313075
// Copyright (C) 2018 The Duniter Project Developers.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Defined the few global types used by all modules,
//! as well as the DuniterModule trait that all modules must implement.
#![cfg_attr(feature
=
"strict"
,
deny(warnings))]
#![deny(
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
extern
crate
duniter_crypto
;
extern
crate
duniter_dal
;
extern
crate
duniter_documents
;
extern
crate
duniter_module
;
extern
crate
duniter_network
;
extern
crate
serde
;
extern
crate
serde_json
;
use
std
::
sync
::
mpsc
;
use
duniter_crypto
::
keys
::
ed25519
;
use
duniter_dal
::
dal_event
::
DALEvent
;
use
duniter_dal
::
dal_requests
::{
DALRequest
,
DALResponse
};
use
duniter_documents
::
blockchain
::
BlockchainProtocol
;
use
duniter_documents
::{
BlockId
,
Hash
};
use
duniter_module
::
ModuleMessage
;
use
duniter_network
::{
NetworkEvent
,
NetworkRequest
};
#[derive(Debug,
Clone)]
/// Message exchanged between Duniter-rs modules
pub
enum
DuniterMessage
{
/// Brut text message
Text
(
String
),
/// Brut json message
Json
(
serde_json
::
Value
),
/// Brut binary message
Binary
(
Vec
<
u8
>
),
/// Subscriptions to the module feed
Followers
(
Vec
<
mpsc
::
Sender
<
DuniterMessage
>>
),
/// Blockchain datas request
DALRequest
(
DALRequest
),
/// Response of DALRequest
DALResponse
(
DALResponse
),
/// Blockchain event
DALEvent
(
DALEvent
),
/// Request to the network module
NetworkRequest
(
NetworkRequest
),
/// Network event
NetworkEvent
(
NetworkEvent
),
/// Request to the pow module
ProverRequest
(
BlockId
,
Hash
),
/// Pow module response
ProverResponse
(
BlockId
,
ed25519
::
Signature
,
u64
),
/// Client API event
ReceiveDocsFromClient
(
Vec
<
BlockchainProtocol
>
),
/// Stop signal
Stop
(),
}
impl
ModuleMessage
for
DuniterMessage
{}
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