Skip to content

Commit

Permalink
Derive Clone for BMP message variants.
Browse files Browse the repository at this point in the history
  • Loading branch information
ximon18 committed Aug 28, 2023
1 parent 51ddaf7 commit 8af066f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/bmp/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Error for MessageError { }
/// including the [`CommonHeader`], possibly a [`PerPeerHeader`] and the
/// additional payload. The payload often comprises one or multiple
/// [`bgp::Message`](crate::bgp::Message)s.

#[derive(Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
pub enum Message<Octets: AsRef<[u8]>> {
RouteMonitoring(RouteMonitoring<Octets>),
Expand Down Expand Up @@ -548,7 +548,7 @@ typeenum!(
/// Route Monitoring message.

#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct RouteMonitoring<Octets: AsRef<[u8]>>
{
octets: Octets
Expand Down Expand Up @@ -598,7 +598,7 @@ impl<Octs: Octets> RouteMonitoring<Octs> {
}

/// Statistics Report message.

#[derive(Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
pub struct StatisticsReport<Octs> {
octets: Octs,
Expand Down Expand Up @@ -662,7 +662,7 @@ impl<Octs: Octets> Debug for StatisticsReport<Octs> {

/// Peer Down Notification.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct PeerDownNotification<Octets: AsRef<[u8]>> {
octets: Octets,
}
Expand Down Expand Up @@ -771,7 +771,7 @@ impl<Octs: Octets> PeerDownNotification<Octs> {

/// Peer Up Notification.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct PeerUpNotification<Octets: AsRef<[u8]>> {
octets: Octets,
}
Expand Down Expand Up @@ -955,7 +955,7 @@ impl<Octs: Octets> PeerUpNotification<Octs> {

/// Initiation Message.
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InitiationMessage<Octets: AsRef<[u8]>> {
octets: Octets,
}
Expand Down Expand Up @@ -995,6 +995,7 @@ impl<Octs: Octets> InitiationMessage<Octs> {


/// Termination message.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
pub struct TerminationMessage<Octets: AsRef<[u8]>> {
octets: Octets,
Expand Down Expand Up @@ -1040,6 +1041,7 @@ impl<Octs: Octets> TerminationMessage<Octs> {
/// RouteMirroring.
///
/// NB: Not well tested/supported at this moment!
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
pub struct RouteMirroring<Octs> {
octets: Octs,
Expand Down

0 comments on commit 8af066f

Please sign in to comment.