Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove async_trait crate and use native method #1987

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions application/apps/indexer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion application/apps/indexer/sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2021"

[dependencies]
async-stream = "0.3"
async-trait = "0.1"
buf_redux = "0.8"
bytes = "1.3"
etherparse = "0.13"
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/binary/pcap/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{
binary::pcap::debug_block, ByteSource, Error as SourceError, ReloadInfo, SourceFilter,
TransportProtocol,
};
use async_trait::async_trait;
use buf_redux::Buffer;
use log::{debug, error, trace};
use pcap_parser::{traits::PcapReaderIterator, LegacyPcapReader, PcapBlockOwned, PcapError};
Expand All @@ -27,7 +26,6 @@ impl<R: Read> PcapLegacyByteSource<R> {
}
}

#[async_trait]
impl<R: Read + Send + Sync> ByteSource for PcapLegacyByteSource<R> {
async fn reload(
&mut self,
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/binary/pcap/ng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{
binary::pcap::debug_block, ByteSource, Error as SourceError, ReloadInfo, SourceFilter,
TransportProtocol,
};
use async_trait::async_trait;
use buf_redux::Buffer;
use log::{debug, error, trace};
use pcap_parser::{traits::PcapReaderIterator, PcapBlockOwned, PcapError, PcapNGReader};
Expand All @@ -27,7 +26,6 @@ impl<R: Read> PcapngByteSource<R> {
}
}

#[async_trait]
impl<R: Read + Send + Sync> ByteSource for PcapngByteSource<R> {
async fn reload(
&mut self,
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/binary/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{
ByteSource, Error as SourceError, ReloadInfo, SourceFilter, DEFAULT_MIN_BUFFER_SPACE,
DEFAULT_READER_CAPACITY,
};
use async_trait::async_trait;
use buf_redux::{policy::MinBuffered, BufReader as ReduxReader};
use std::io::{BufRead, Read, Seek};

Expand Down Expand Up @@ -34,7 +33,6 @@ where
}
}

#[async_trait]
impl<R: Read + Send + Sync + Seek> ByteSource for BinaryByteSource<R> {
async fn reload(
&mut self,
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/command/process.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{sde, ByteSource, Error as SourceError, ReloadInfo, SourceFilter};
use async_trait::async_trait;
use buf_redux::Buffer;
use futures;
use regex::{Captures, Regex};
Expand Down Expand Up @@ -155,7 +154,6 @@ impl ProcessSource {
}
}

#[async_trait]
impl ByteSource for ProcessSource {
async fn reload(
&mut self,
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![deny(unused_crate_dependencies)]
use async_trait::async_trait;
use thiserror::Error;

#[macro_use]
Expand Down Expand Up @@ -84,7 +83,6 @@ pub(crate) const DEFAULT_MIN_BUFFER_SPACE: usize = 10 * 1024;
/// want to extract the data part from certain frames, the `relaod` method will load only the relevant
/// data into an internal buffer.
/// This data can then be accessed via the `current_slice` method.
#[async_trait]
pub trait ByteSource: Send + Sync {
/// Indicate that we have consumed a certain amount of data from our internal
/// buffer and that this part can be discarded
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/serial/serialport.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
factory::SerialTransportConfig, sde, ByteSource, Error as SourceError, ReloadInfo, SourceFilter,
};
use async_trait::async_trait;
use buf_redux::Buffer;
use bytes::{BufMut, BytesMut};
use futures::{
Expand Down Expand Up @@ -129,7 +128,6 @@ impl SerialSource {
}
}

#[async_trait]
impl ByteSource for SerialSource {
async fn reload(
&mut self,
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/socket/tcp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{ByteSource, Error as SourceError, ReloadInfo, SourceFilter};
use async_trait::async_trait;
use buf_redux::Buffer;
use tokio::net::{TcpStream, ToSocketAddrs};

Expand All @@ -21,7 +20,6 @@ impl TcpSource {
}
}

#[async_trait]
impl ByteSource for TcpSource {
async fn reload(
&mut self,
Expand Down
2 changes: 0 additions & 2 deletions application/apps/indexer/sources/src/socket/udp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{ByteSource, Error as SourceError, ReloadInfo, SourceFilter};
use async_trait::async_trait;
use buf_redux::Buffer;
use indexer_base::config::MulticastInfo;
use log::trace;
Expand Down Expand Up @@ -75,7 +74,6 @@ impl UdpSource {
}
}

#[async_trait]
impl ByteSource for UdpSource {
async fn reload(
&mut self,
Expand Down
1 change: 0 additions & 1 deletion application/apps/rustcore/rs-bindings/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading