@@ -7,7 +7,7 @@ use dyn_clone::{DynClone, clone_trait_object};
77
88use jvm:: { ClassDefinition , Jvm , Result as JvmResult } ;
99
10- pub use io:: { File , FileSize , FileStat , FileType , IOError , IOResult } ;
10+ pub use io:: { File , FileDescriptorId , FileSize , FileStat , FileType , IOError , IOResult } ;
1111
1212#[ async_trait:: async_trait]
1313pub trait SpawnCallback : Sync + Send {
@@ -23,11 +23,13 @@ pub trait Runtime: Sync + Send + DynClone {
2323 fn now ( & self ) -> u64 ; // unix time in millis
2424 fn current_task_id ( & self ) -> u64 ;
2525
26- fn stdin ( & self ) -> IOResult < Box < dyn File > > ;
27- fn stdout ( & self ) -> IOResult < Box < dyn File > > ;
28- fn stderr ( & self ) -> IOResult < Box < dyn File > > ;
26+ fn stdin ( & self ) -> IOResult < FileDescriptorId > ;
27+ fn stdout ( & self ) -> IOResult < FileDescriptorId > ;
28+ fn stderr ( & self ) -> IOResult < FileDescriptorId > ;
2929
30- async fn open ( & self , path : & str , write : bool ) -> IOResult < Box < dyn File > > ;
30+ async fn open ( & self , path : & str , write : bool ) -> IOResult < FileDescriptorId > ;
31+ fn get_file ( & self , fd : FileDescriptorId ) -> IOResult < Box < dyn File > > ;
32+ fn close_file ( & self , fd : FileDescriptorId ) ;
3133 async fn unlink ( & self , path : & str ) -> IOResult < ( ) > ;
3234 async fn metadata ( & self , path : & str ) -> IOResult < FileStat > ;
3335
0 commit comments