mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
364 B
Rust
21 lines
364 B
Rust
#![crate_name="socketlib"]
|
|
#![crate_type = "lib"]
|
|
|
|
pub mod socket {
|
|
pub struct socket_handle {
|
|
sockfd: u32,
|
|
}
|
|
|
|
impl Drop for socket_handle {
|
|
fn drop(&mut self) {
|
|
/* c::close(self.sockfd); */
|
|
}
|
|
}
|
|
|
|
pub fn socket_handle(x: u32) -> socket_handle {
|
|
socket_handle {
|
|
sockfd: x
|
|
}
|
|
}
|
|
}
|