Skip to content

Commit d2feae1

Browse files
committed
---
yaml --- r: 53926 b: refs/heads/dist-snap c: 7ef54c7 h: refs/heads/master v: v3
1 parent ecaed85 commit d2feae1

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 57e85b5f947387195cec1338fcb94b7cfb88bd86
10+
refs/heads/dist-snap: 7ef54c7ecd625376de092cbd741621987673c45f
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/rt/uv.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,42 @@ impl NativeHandle<*uvll::uv_write_t> for WriteRequest {
498498
}
499499
}
500500

501+
type FsCallback = ~fn(FsRequest, Option<UvError>);
502+
impl Callback for FsCallback { }
503+
504+
pub struct FsRequest(*uvll::uv_fs_t);
505+
506+
impl Request for FsRequest;
507+
508+
impl FsRequest {
509+
static fn new() -> FsRequest {
510+
let fs_req = unsafe { malloc_req(UV_FS) };
511+
fail_unless!(fs_req.is_not_null());
512+
let fs_req = fs_req as *uvll::uv_write_t;
513+
uvll::set_data_for_uv_req(fs_req, null::<()>());
514+
Native(fs_req)
515+
}
516+
517+
fn delete(self) {
518+
unsafe { free_req(self.native_handle() as *c_void) }
519+
}
520+
521+
fn open(&mut self, loop_: &EventLoop, cb: FsCallback) {
522+
}
523+
524+
fn close(&mut self, loop_: &EventLoop, cb: FsCallback) {
525+
}
526+
}
527+
528+
impl NativeHandle<*uvll::uv_fs_t> for FsRequest {
529+
static fn from_native_handle(handle: *uvll:: uv_fs_t) -> FsRequest {
530+
FsRequest(handle)
531+
}
532+
fn native_handle(&self) -> *uvll::uv_fs_t {
533+
match self { &FsRequest(ptr) => ptr }
534+
}
535+
}
536+
501537
// XXX: Need to define the error constants like EOF so they can be
502538
// compared to the UvError type
503539

0 commit comments

Comments
 (0)