Skip to content

Commit

Permalink
rust: add payload trait in message mod
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Buffon <[email protected]>
  • Loading branch information
nbuffon committed Nov 23, 2023
1 parent 22b7bf5 commit 6fbfd17
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rust/src/exchange/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
// Author: Nicolas BUFFON <[email protected]> et al.
// Software description: This Intelligent Transportation Systems (ITS) [MQTT](https://mqtt.org/) client based on the [JSon](https://www.json.org) [ETSI](https://www.etsi.org/committee/its) specification transcription provides a ready to connect project for the mobility (connected and autonomous vehicles, road side units, vulnerable road users,...).

pub(crate) mod payload;

enum Message {}
18 changes: 18 additions & 0 deletions rust/src/exchange/message/payload.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Software Name: its-client
// SPDX-FileCopyrightText: Copyright (c) 2016-2022 Orange
// SPDX-License-Identifier: MIT License
//
// This software is distributed under the MIT license, see LICENSE.txt file for more details.
//
// Author: Nicolas BUFFON <[email protected]> et al.
// Software description: This Intelligent Transportation Systems (ITS) [MQTT](https://mqtt.org/) client based on the [JSon](https://www.json.org) [ETSI](https://www.etsi.org/committee/its) specification transcription provides a ready to connect project for the mobility (connected and autonomous vehicles, road side units, vulnerable road users,...).

use crate::mobility::mobile::Mobile;

pub trait Payload {
fn get_type(&self) -> &str;

fn appropriate(&mut self);

fn as_mobile(&self) -> Result<&dyn Mobile, &'static str>;
}

0 comments on commit 6fbfd17

Please sign in to comment.