move out dummy webrtc mod

This commit is contained in:
lc
2025-11-14 01:09:08 +08:00
parent 67ad83a2b2
commit f8d1d4207d
5 changed files with 77 additions and 101 deletions

46
examples/webrtc_dummy.rs Normal file
View File

@@ -0,0 +1,46 @@
use std::io::Error;
use bytes::BytesMut;
use hbb_common::ResultType;
pub struct WebRTCStream {
// mock struct
}
impl Clone for WebRTCStream {
fn clone(&self) -> Self {
WebRTCStream {
}
}
}
impl WebRTCStream {
pub async fn new(
_: &str,
_: u64,
) -> ResultType<Self> {
Ok(Self {})
}
#[inline]
pub async fn get_local_endpoint(&self) -> ResultType<String> {
Ok(String::new())
}
#[inline]
pub async fn set_remote_endpoint(&self, _: &str) -> ResultType<()> {
Ok(())
}
#[inline]
pub async fn send_bytes(&mut self, _: bytes::Bytes) -> ResultType<()> {
Ok(())
}
#[inline]
pub async fn next(&mut self) -> Option<Result<BytesMut, Error>> {
None
}
}