Remove *Socket::{process,dispatch} from public interface.

These no longer have to be public, since our required Rust version
has pub(crate).
v0.7.x
whitequark 2017-06-30 20:54:58 +00:00
parent 938fb99070
commit 3f9805b2c1
3 changed files with 12 additions and 17 deletions

View File

@ -145,9 +145,8 @@ impl<'a, 'b> RawSocket<'a, 'b> {
Ok(buffer.len())
}
/// See [Socket::process](enum.Socket.html#method.process).
pub fn process(&mut self, _timestamp: u64, ip_repr: &IpRepr,
payload: &[u8]) -> Result<(), Error> {
pub(crate) fn process(&mut self, _timestamp: u64, ip_repr: &IpRepr,
payload: &[u8]) -> Result<(), Error> {
match self.ip_version {
IpVersion::Ipv4 => {
if ip_repr.protocol() != self.ip_protocol {
@ -169,8 +168,8 @@ impl<'a, 'b> RawSocket<'a, 'b> {
}
/// See [Socket::dispatch](enum.Socket.html#method.dispatch).
pub fn dispatch<F, R>(&mut self, _timestamp: u64, _limits: &DeviceLimits,
emit: &mut F) -> Result<R, Error>
pub(crate) fn dispatch<F, R>(&mut self, _timestamp: u64, _limits: &DeviceLimits,
emit: &mut F) -> Result<R, Error>
where F: FnMut(&IpRepr, &IpPayload) -> Result<R, Error> {
let mut packet_buf = self.tx_buffer.dequeue_mut().map_err(|()| Error::Exhausted)?;
net_trace!("[{}]:{}:{}: sending {} octets",

View File

@ -631,9 +631,8 @@ impl<'a> TcpSocket<'a> {
self.state = state
}
/// See [Socket::process](enum.Socket.html#method.process).
pub fn process(&mut self, timestamp: u64, ip_repr: &IpRepr,
payload: &[u8]) -> Result<(), Error> {
pub(crate) fn process(&mut self, timestamp: u64, ip_repr: &IpRepr,
payload: &[u8]) -> Result<(), Error> {
debug_assert!(ip_repr.protocol() == IpProtocol::Tcp);
if self.state == State::Closed { return Err(Error::Rejected) }
@ -953,9 +952,8 @@ impl<'a> TcpSocket<'a> {
Ok(())
}
/// See [Socket::dispatch](enum.Socket.html#method.dispatch).
pub fn dispatch<F, R>(&mut self, timestamp: u64, limits: &DeviceLimits,
emit: &mut F) -> Result<R, Error>
pub(crate) fn dispatch<F, R>(&mut self, timestamp: u64, limits: &DeviceLimits,
emit: &mut F) -> Result<R, Error>
where F: FnMut(&IpRepr, &IpPayload) -> Result<R, Error> {
if self.remote_endpoint.is_unspecified() { return Err(Error::Exhausted) }

View File

@ -150,9 +150,8 @@ impl<'a, 'b> UdpSocket<'a, 'b> {
Ok((buffer.len(), endpoint))
}
/// See [Socket::process](enum.Socket.html#method.process).
pub fn process(&mut self, _timestamp: u64, ip_repr: &IpRepr,
payload: &[u8]) -> Result<(), Error> {
pub(crate) fn process(&mut self, _timestamp: u64, ip_repr: &IpRepr,
payload: &[u8]) -> Result<(), Error> {
debug_assert!(ip_repr.protocol() == IpProtocol::Udp);
let packet = UdpPacket::new_checked(&payload[..ip_repr.payload_len()])?;
@ -173,9 +172,8 @@ impl<'a, 'b> UdpSocket<'a, 'b> {
Ok(())
}
/// See [Socket::dispatch](enum.Socket.html#method.dispatch).
pub fn dispatch<F, R>(&mut self, _timestamp: u64, _limits: &DeviceLimits,
emit: &mut F) -> Result<R, Error>
pub(crate) fn dispatch<F, R>(&mut self, _timestamp: u64, _limits: &DeviceLimits,
emit: &mut F) -> Result<R, Error>
where F: FnMut(&IpRepr, &IpPayload) -> Result<R, Error> {
let packet_buf = self.tx_buffer.dequeue().map_err(|()| Error::Exhausted)?;
net_trace!("[{}]{}:{}: sending {} octets",