xref: /DragonOS/kernel/src/net/mod.rs (revision 78bf93f02f84bf5e024ddfb559f040e68ce39ccf)
1 use core::fmt::Debug;
2 
3 use crate::syscall::SystemError;
4 
5 pub trait Socket: Sync + Send + Debug {
6     fn read(&self, buf: &mut [u8]) -> Result<usize, SystemError>;
7 
8     fn write(&self, buf: &[u8]) -> Result<usize, SystemError>;
9 }
10