std::rt: Some I/O cleanup
This commit is contained in:
parent
d84a7b5ae3
commit
b3f7f758b1
@ -139,15 +139,17 @@ fn native_handle(&self) -> *uvll::uv_fs_t {
|
||||
match self { &FsRequest(ptr) => ptr }
|
||||
}
|
||||
}
|
||||
fn sync_cleanup(loop_: &Loop, result: int)
|
||||
-> Result<int, UvError> {
|
||||
match status_to_maybe_uv_error_with_loop(loop_.native_handle(), result as i32) {
|
||||
Some(err) => Err(err),
|
||||
None => Ok(result)
|
||||
}
|
||||
|
||||
fn sync_cleanup(loop_: &Loop, result: int)
|
||||
-> Result<int, UvError> {
|
||||
match status_to_maybe_uv_error_with_loop(loop_.native_handle(), result as i32) {
|
||||
Some(err) => Err(err),
|
||||
None => Ok(result)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FileDescriptor(c_int);
|
||||
|
||||
impl FileDescriptor {
|
||||
fn new(fd: c_int) -> FileDescriptor {
|
||||
FileDescriptor(fd)
|
||||
|
@ -132,7 +132,8 @@ fn native_handle(&self) -> *uvll::uv_loop_t {
|
||||
pub type UdpSendCallback = ~fn(UdpWatcher, Option<UvError>);
|
||||
|
||||
|
||||
/// Callbacks used by StreamWatchers, set as custom data on the foreign handle
|
||||
/// Callbacks used by StreamWatchers, set as custom data on the foreign handle.
|
||||
/// XXX: Would be better not to have all watchers allocate room for all callback types.
|
||||
struct WatcherData {
|
||||
read_cb: Option<ReadCallback>,
|
||||
write_cb: Option<ConnectionCallback>,
|
||||
|
Loading…
Reference in New Issue
Block a user