mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 14:16:47 +00:00
fmt (#1110)
This commit is contained in:
parent
91511c9de9
commit
9fb1d18715
@ -30,12 +30,12 @@ impl Buffer {
|
||||
return self.metadata.buf_size - self.read_buffer.lock().len() == 0;
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn is_write_buf_empty(&self) -> bool {
|
||||
return self.write_buffer.lock().is_empty();
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn is_write_buf_full(&self) -> bool {
|
||||
return self.write_buffer.lock().len() >= self.metadata.buf_size;
|
||||
}
|
||||
@ -62,7 +62,7 @@ impl Buffer {
|
||||
Ok(len)
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn write_write_buffer(&self, buf: &[u8]) -> Result<usize, SystemError> {
|
||||
let mut buffer = self.write_buffer.lock_irqsave();
|
||||
|
||||
|
@ -138,7 +138,7 @@ pub struct Connected {
|
||||
|
||||
impl Connected {
|
||||
/// 默认的缓冲区大小
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub const DEFAULT_BUF_SIZE: usize = 64 * 1024;
|
||||
|
||||
pub fn new_pair(
|
||||
@ -159,12 +159,12 @@ impl Connected {
|
||||
(this, peer)
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn set_peer_inode(&mut self, peer_epoint: Option<Endpoint>) {
|
||||
self.peer_inode = peer_epoint;
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn set_inode(&mut self, epoint: Option<Endpoint>) {
|
||||
self.inode = epoint;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ pub struct SeqpacketSocket {
|
||||
|
||||
impl SeqpacketSocket {
|
||||
/// 默认的元数据缓冲区大小
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub const DEFAULT_METADATA_BUF_SIZE: usize = 1024;
|
||||
/// 默认的缓冲区大小
|
||||
pub const DEFAULT_BUF_SIZE: usize = 64 * 1024;
|
||||
@ -51,7 +51,7 @@ impl SeqpacketSocket {
|
||||
return Ok(inode);
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn new_connected(connected: Connected, is_nonblocking: bool) -> Arc<Self> {
|
||||
Arc::new_cyclic(|me| Self {
|
||||
inner: RwLock::new(Inner::Connected(connected)),
|
||||
|
@ -90,7 +90,7 @@ impl Connected {
|
||||
self.addr.as_ref()
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn set_addr(&mut self, addr: Option<Endpoint>) {
|
||||
self.addr = addr;
|
||||
}
|
||||
@ -99,7 +99,7 @@ impl Connected {
|
||||
self.peer_addr.as_ref()
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn set_peer_addr(&mut self, peer: Option<Endpoint>) {
|
||||
self.peer_addr = peer;
|
||||
}
|
||||
@ -166,7 +166,7 @@ impl Connected {
|
||||
return Err(SystemError::EINVAL);
|
||||
}
|
||||
}
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn shutdown(&self, how: ShutdownTemp) -> Result<(), SystemError> {
|
||||
if how.is_empty() {
|
||||
return Err(SystemError::EINVAL);
|
||||
@ -214,7 +214,7 @@ impl Listener {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn pop_incoming(&self) -> Option<Arc<Inode>> {
|
||||
let mut incoming_connects = self.incoming_connects.lock();
|
||||
|
||||
|
@ -31,7 +31,7 @@ pub struct StreamSocket {
|
||||
|
||||
impl StreamSocket {
|
||||
/// 默认的元数据缓冲区大小
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub const DEFAULT_METADATA_BUF_SIZE: usize = 1024;
|
||||
/// 默认的缓冲区大小
|
||||
pub const DEFAULT_BUF_SIZE: usize = 64 * 1024;
|
||||
@ -61,7 +61,7 @@ impl StreamSocket {
|
||||
|
||||
return Ok((inode0, inode1));
|
||||
}
|
||||
#[allow(unused)]
|
||||
#[allow(dead_code)]
|
||||
pub fn new_connected(connected: Connected) -> Arc<Self> {
|
||||
Arc::new_cyclic(|me| Self {
|
||||
inner: RwLock::new(Inner::Connected(connected)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user