File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -122,16 +122,30 @@ pub struct Fd {
122
122
pub rights_inheriting : __wasi_rights_t ,
123
123
pub flags : __wasi_fdflags_t ,
124
124
pub offset : u64 ,
125
- /// Used when reopening the file on the host system
125
+ /// Flags that determine how the [`Fd`] can be used.
126
+ ///
127
+ /// Used when reopening a [`HostFile`] during [`WasiState`] deserialization.
126
128
pub open_flags : u16 ,
127
129
pub inode : Inode ,
128
130
}
129
131
130
132
impl Fd {
133
+ /// This [`Fd`] can be used with read system calls.
131
134
pub const READ : u16 = 1 ;
135
+ /// This [`Fd`] can be used with write system calls.
132
136
pub const WRITE : u16 = 2 ;
137
+ /// This [`Fd`] can append in write system calls. Note that the append
138
+ /// permission implies the write permission.
133
139
pub const APPEND : u16 = 4 ;
140
+ /// This [`Fd`] will delete everything before writing. Note that truncate
141
+ /// permissions require the write permission.
142
+ ///
143
+ /// This permission is currently unused when deserializing [`WasiState`].
134
144
pub const TRUNCATE : u16 = 8 ;
145
+ /// This [`Fd`] may create a file before writing to it. Note that create
146
+ /// permissions require write permissions.
147
+ ///
148
+ /// This permission is currently unused when deserializing [`WasiState`].
135
149
pub const CREATE : u16 = 16 ;
136
150
}
137
151
You can’t perform that action at this time.
0 commit comments