Home
last modified time | relevance | path

Searched refs:Result (Results 1 – 25 of 70) sorted by relevance

123

/DragonOS-0.1.7/kernel/src/filesystem/vfs/
Dmount.rs104 fn is_mountpoint_root(&self) -> Result<bool, SystemError> { in is_mountpoint_root()
126 fn open(&self, data: &mut FilePrivateData, mode: &FileMode) -> Result<(), SystemError> { in open() argument
130 fn close(&self, data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument
140 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create_with_data()
146 fn truncate(&self, len: usize) -> Result<(), SystemError> { in truncate() argument
156 ) -> Result<usize, SystemError> { in read_at()
166 ) -> Result<usize, SystemError> { in write_at()
171 fn poll(&self) -> Result<super::PollStatus, SystemError> { in poll()
186 fn metadata(&self) -> Result<super::Metadata, SystemError> { in metadata()
191 fn set_metadata(&self, metadata: &super::Metadata) -> Result<(), SystemError> { in set_metadata() argument
[all …]
Dmod.rs92 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument
101 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument
121 ) -> Result<usize, SystemError>; in read_at()
138 ) -> Result<usize, SystemError>; in write_at()
143 fn poll(&self) -> Result<PollStatus, SystemError>; in poll()
149 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
158 fn set_metadata(&self, _metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument
167 fn resize(&self, _len: usize) -> Result<(), SystemError> { in resize() argument
185 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create()
205 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create_with_data()
[all …]
Dcore.rs117 ) -> Result<(), SystemError> { in do_migrate() argument
135 fn migrate_virtual_filesystem(new_fs: Arc<dyn FileSystem>) -> Result<(), SystemError> { in migrate_virtual_filesystem() argument
181 let fatfs: Result<Arc<FATFileSystem>, SystemError> = FATFileSystem::new(partiton); in mount_root_fs()
205 pub fn do_open(path: &str, mode: FileMode) -> Result<i32, SystemError> { in do_open()
211 let inode: Result<Arc<dyn IndexNode>, SystemError> = ROOT_INODE().lookup(path); in do_open()
268 pub fn do_read(fd: i32, buf: &mut [u8]) -> Result<usize, SystemError> { in do_read()
285 pub fn do_write(fd: i32, buf: &[u8]) -> Result<usize, SystemError> { in do_write()
302 pub fn do_lseek(fd: i32, seek: SeekFrom) -> Result<usize, SystemError> { in do_lseek()
312 pub fn do_mkdir(path: &str, _mode: FileMode) -> Result<u64, SystemError> { in do_mkdir()
318 let inode: Result<Arc<dyn IndexNode>, SystemError> = ROOT_INODE().lookup(path); in do_mkdir()
[all …]
Dfile.rs106 pub fn new(inode: Arc<dyn IndexNode>, mode: FileMode) -> Result<Self, SystemError> { in new()
128 pub fn read(&mut self, len: usize, buf: &mut [u8]) -> Result<usize, SystemError> { in read()
149 pub fn write(&mut self, len: usize, buf: &[u8]) -> Result<usize, SystemError> { in write()
163 pub fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
168 pub fn get_entry_name(&self, ino: usize) -> Result<String, SystemError> { in get_entry_name()
175 pub fn lseek(&mut self, origin: SeekFrom) -> Result<usize, SystemError> { in lseek()
205 pub fn readable(&self) -> Result<(), SystemError> { in readable() argument
216 pub fn writeable(&self) -> Result<(), SystemError> { in writeable() argument
227 pub fn readdir(&mut self, dirent: &mut Dirent) -> Result<u64, SystemError> { in readdir()
303 let r: Result<(), SystemError> = self.inode.close(&mut self.private_data); in drop()
/DragonOS-0.1.7/kernel/src/libs/
Dvec_cursor.rs45 pub fn read_u8(&mut self) -> Result<u8, SystemError> { in read_u8()
54 pub fn read_u16(&mut self) -> Result<u16, SystemError> { in read_u16()
68 pub fn read_u32(&mut self) -> Result<u32, SystemError> { in read_u32()
82 pub fn read_u64(&mut self) -> Result<u64, SystemError> { in read_u64()
101 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact() argument
113 pub fn read_u16_into(&mut self, buf: &mut [u16]) -> Result<(), SystemError> { in read_u16_into() argument
131 pub fn seek(&mut self, origin: SeekFrom) -> Result<usize, SystemError> { in seek()
157 pub fn write_u8(&mut self, value: u8) -> Result<u8, SystemError> { in write_u8()
169 pub fn write_u16(&mut self, value: u16) -> Result<u16, SystemError> { in write_u16()
183 pub fn write_u32(&mut self, value: u32) -> Result<u32, SystemError> { in write_u32()
[all …]
Dlockref.rs50 fn cmpxchg_loop(&mut self, mode: CmpxchgMode) -> Result<i32, i32> { in cmpxchg_loop()
120 fn cmpxchg_loop(&mut self, mode: CmpxchgMode) -> Result<i32, i32> { in cmpxchg_loop()
144 pub fn inc_not_zero(&mut self) -> Result<i32, SystemError> { in inc_not_zero()
172 pub fn inc_not_dead(&mut self) -> Result<i32, SystemError> { in inc_not_dead()
202 pub fn dec(&mut self) -> Result<i32, SystemError> { in dec()
209 let retval: Result<i32, SystemError>; in dec()
234 pub fn dec_return(&mut self) -> Result<i32, SystemError> { in dec_return()
262 pub fn dec_not_zero(&mut self) -> Result<i32, SystemError> { in dec_not_zero()
272 let retval: Result<i32, SystemError>; in dec_not_zero()
293 pub fn dec_or_lock_not_zero(&mut self) -> Result<i32, SystemError> { in dec_or_lock_not_zero()
[all …]
/DragonOS-0.1.7/kernel/src/net/
Dmod.rs43 fn try_from(value: i32) -> Result<Self, Self::Error> { in try_from()
72 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint); in read()
80 fn write(&self, buf: &[u8], to: Option<Endpoint>) -> Result<usize, SystemError>; in write()
92 fn connect(&mut self, endpoint: Endpoint) -> Result<(), SystemError>; in connect() argument
101 fn bind(&mut self, _endpoint: Endpoint) -> Result<(), SystemError> { in bind() argument
112 fn shutdown(&self, _type: ShutdownType) -> Result<(), SystemError> { in shutdown() argument
121 fn listen(&mut self, _backlog: usize) -> Result<(), SystemError> { in listen() argument
130 fn accept(&mut self) -> Result<(Box<dyn Socket>, Endpoint), SystemError> { in accept()
177 ) -> Result<usize, SystemError> { in ioctl()
182 fn metadata(&self) -> Result<SocketMetadata, SystemError>; in metadata()
[all …]
Dsocket.rs161 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint) { in read()
192 fn write(&self, buf: &[u8], to: Option<super::Endpoint>) -> Result<usize, SystemError> { in write()
269 fn connect(&mut self, _endpoint: super::Endpoint) -> Result<(), SystemError> { in connect() argument
273 fn metadata(&self) -> Result<SocketMetadata, SystemError> { in metadata()
327 fn do_bind(&self, socket: &mut udp::Socket, endpoint: Endpoint) -> Result<(), SystemError> { in do_bind() argument
347 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint) { in read()
373 fn write(&self, buf: &[u8], to: Option<super::Endpoint>) -> Result<usize, SystemError> { in write()
430 fn bind(&mut self, endpoint: Endpoint) -> Result<(), SystemError> { in bind() argument
445 fn connect(&mut self, endpoint: super::Endpoint) -> Result<(), SystemError> { in connect() argument
460 ) -> Result<usize, SystemError> { in ioctl()
[all …]
/DragonOS-0.1.7/kernel/src/driver/tty/
Dmod.rs103 pub fn input(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in input()
120 pub fn output(&self, buf: &mut [u8], block: bool) -> Result<usize, TtyError> { in output()
131 pub fn stdout(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in stdout()
142 pub fn stderr(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in stderr()
153 pub fn read_stdin(&self, buf: &mut [u8], block: bool) -> Result<usize, TtyError> { in read_stdin()
157 let val: Result<mpsc::RecvRef<u8>, TryRecvError> = self.stdin_rx.try_recv_ref(); in read_stdin()
187 fn write_stdin(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in write_stdin()
190 let r: Result<mpsc::SendRef<u8>, TrySendError> = self.stdin_tx.try_send_ref(); in write_stdin()
219 fn read_output(&self, buf: &mut [u8], block: bool) -> Result<usize, TtyError> { in read_output()
222 let val: Result<mpsc::RecvRef<u8>, TryRecvError> = self.output_rx.try_recv_ref(); in read_output()
[all …]
Dtty_device.rs63 ) -> Result<&'a mut TtyFilePrivateData, SystemError> { in verify_file_private_data()
78 pub fn check_rw_param(&self, len: usize, buf: &[u8]) -> Result<(), SystemError> { in check_rw_param() argument
86 pub fn input(&self, buf: &[u8]) -> Result<usize, SystemError> { in input()
87 let r: Result<usize, TtyError> = self.core.input(buf, false); in input()
120 fn open(&self, data: &mut FilePrivateData, mode: &FileMode) -> Result<(), SystemError> { in open() argument
148 ) -> Result<usize, SystemError> { in read_at()
159 let r: Result<usize, TtyError> = self.core.read_stdin(&mut buf[0..len], true); in read_at()
182 ) -> Result<usize, SystemError> { in write_at()
194 let r: Result<usize, TtyError> = if data.flags.contains(TtyFileFlag::STDOUT) { in write_at()
212 fn poll(&self) -> Result<crate::filesystem::vfs::PollStatus, SystemError> { in poll()
[all …]
/DragonOS-0.1.7/kernel/src/filesystem/devfs/
Dnull_dev.rs72 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument
76 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument
80 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
88 fn list(&self) -> Result<Vec<String>, SystemError> { in list()
92 fn set_metadata(&self, metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument
104 fn poll(&self) -> Result<PollStatus, SystemError> { in poll()
115 ) -> Result<usize, SystemError> { in read_at()
134 ) -> Result<usize, SystemError> { in write_at()
Dzero_dev.rs72 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument
76 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument
80 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
88 fn list(&self) -> Result<Vec<String>, SystemError> { in list()
92 fn set_metadata(&self, metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument
104 fn poll(&self) -> Result<PollStatus, SystemError> { in poll()
115 ) -> Result<usize, SystemError> { in read_at()
134 ) -> Result<usize, SystemError> { in write_at()
Dmod.rs102 ) -> Result<(), SystemError> { in register_device() argument
153 ) -> Result<(), SystemError> { in unregister_device() argument
248 pub fn add_dir(&self, name: &str) -> Result<(), SystemError> { in add_dir() argument
265 pub fn add_dev(&self, name: &str, dev: Arc<dyn IndexNode>) -> Result<(), SystemError> { in add_dev() argument
276 pub fn remove(&self, name: &str) -> Result<(), SystemError> { in remove() argument
295 ) -> Result<Arc<dyn IndexNode>, SystemError> { in do_create_with_data()
347 ) -> Result<(), SystemError> { in open() argument
351 fn close(&self, _data: &mut super::vfs::FilePrivateData) -> Result<(), SystemError> { in close() argument
361 ) -> Result<Arc<dyn IndexNode>, SystemError> { in create_with_data()
368 fn find(&self, name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in find()
[all …]
/DragonOS-0.1.7/kernel/src/driver/disk/ahci/
Dahci_inode.rs78 fn open(&self, _data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument
82 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument
86 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
94 fn list(&self) -> Result<Vec<String>, SystemError> { in list()
98 fn set_metadata(&self, metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument
110 fn poll(&self) -> Result<PollStatus, SystemError> { in poll()
121 ) -> Result<usize, SystemError> { in read_at()
140 ) -> Result<usize, SystemError> { in write_at()
/DragonOS-0.1.7/kernel/src/filesystem/sysfs/
Dclass.rs10 pub fn sys_class_register(class_name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in sys_class_register()
25 pub fn sys_class_unregister(class_name: &str) -> Result<(), SystemError> { in sys_class_unregister() argument
44 ) -> Result<Arc<dyn IndexNode>, SystemError> { in class_device_register()
62 ) -> Result<(), SystemError> { in class_device_unregister() argument
Dmod.rs158 ) -> Result<(), SystemError> { in open() argument
162 fn close(&self, _data: &mut super::vfs::FilePrivateData) -> Result<(), SystemError> { in close() argument
172 ) -> Result<usize, SystemError> { in read_at()
182 ) -> Result<usize, SystemError> { in write_at()
186 fn poll(&self) -> Result<super::vfs::PollStatus, SystemError> { in poll()
198 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
206 fn get_entry_name(&self, ino: super::vfs::InodeId) -> Result<String, SystemError> { in get_entry_name()
238 fn find(&self, name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in find()
263 fn ioctl(&self, _cmd: u32, _data: usize) -> Result<usize, SystemError> { in ioctl()
267 fn list(&self) -> Result<Vec<String>, SystemError> { in list()
[all …]
Dbus.rs10 pub fn sys_bus_register(bus_name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in sys_bus_register()
25 pub fn sys_bus_unregister(bus_name: &str) -> Result<(), SystemError> { in sys_bus_unregister() argument
40 ) -> Result<(Arc<dyn IndexNode>, Arc<dyn IndexNode>), SystemError> { in sys_bus_init()
Ddevices.rs10 pub fn sys_device_register(device_name: &str) -> Result<Arc<dyn IndexNode>, SystemError> { in sys_device_register()
25 pub fn sys_device_unregister(device_name: &str) -> Result<(), SystemError> { in sys_device_unregister() argument
/DragonOS-0.1.7/kernel/src/driver/keyboard/
Dps2_keyboard.rs99 ) -> Result<usize, SystemError> { in read_at()
119 ) -> Result<usize, SystemError> { in write_at()
127 ) -> Result<(), SystemError> { in open() argument
141 ) -> Result<(), SystemError> { in close() argument
152 fn poll(&self) -> Result<PollStatus, SystemError> { in poll()
156 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
160 fn set_metadata(&self, metadata: &Metadata) -> Result<(), SystemError> { in set_metadata() argument
180 fn list(&self) -> Result<alloc::vec::Vec<alloc::string::String>, SystemError> { in list()
/DragonOS-0.1.7/kernel/src/driver/net/
Dmod.rs22 fn poll(&self, sockets: &mut iface::SocketSet) -> Result<(), SystemError>; in poll() argument
24 fn update_ip_addrs(&self, ip_addrs: &[wire::IpCidr]) -> Result<(), SystemError>; in update_ip_addrs() argument
/DragonOS-0.1.7/docs/community/code_contribution/
Drust-coding-style.md36 fn foo() -> Result<(), CustomErr> {
45 fn foo() -> Result<(), SystemError> {
86 &emsp;&emsp;如果函数的返回值是`Result`类型,那么返回值应当这样进行解释:
/DragonOS-0.1.7/docs/kernel/locking/
Dlockref.md62 - `pub fn inc_not_zero(&mut self) -> Result<i32, SystemError>`
63 - `pub fn inc_not_dead(&mut self) -> Result<i32, SystemError>`
102 - `pub fn dec(&mut self) -> Result<i32, SystemError>`
103 - `pub fn dec_return(&mut self) -> Result<i32, SystemError>`
104 - `pub fn dec_not_zero(&mut self) -> Result<i32, SystemError>`
105 - `pub fn dec_or_lock_not_zero(&mut self) -> Result<i32, SystemError>`
/DragonOS-0.1.7/kernel/src/filesystem/procfs/
Dmod.rs116 fn open_status(&self, pdata: &mut ProcfsFilePrivateData) -> Result<i64, SystemError> { in open_status()
200 ) -> Result<usize, SystemError> { in read_status()
280 pub fn register_pid(&self, pid: i64) -> Result<(), SystemError> { in register_pid() argument
302 pub fn unregister_pid(&self, pid: i64) -> Result<(), SystemError> { in unregister_pid() argument
321 fn open(&self, data: &mut FilePrivateData, _mode: &FileMode) -> Result<(), SystemError> { in open() argument
344 fn close(&self, data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument
368 ) -> Result<usize, SystemError> { in read_at()
415 ) -> Result<usize, SystemError> { in write_at()
419 fn poll(&self) -> Result<PollStatus, SystemError> { in poll()
439 fn metadata(&self) -> Result<Metadata, SystemError> { in metadata()
[all …]
/DragonOS-0.1.7/kernel/src/ipc/
Dpipe.rs81 ) -> Result<usize, crate::syscall::SystemError> { in read_at()
138 ) -> Result<(), SystemError> { in open() argument
142 fn metadata(&self) -> Result<crate::filesystem::vfs::Metadata, SystemError> { in metadata()
150 fn close(&self, _data: &mut FilePrivateData) -> Result<(), SystemError> { in close() argument
160 ) -> Result<usize, crate::syscall::SystemError> { in write_at()
205 fn poll(&self) -> Result<PollStatus, crate::syscall::SystemError> { in poll()
216 ) -> Result<(alloc::string::String, crate::filesystem::vfs::Metadata), SystemError> { in get_entry_name_and_metadata()
227 fn list(&self) -> Result<alloc::vec::Vec<alloc::string::String>, SystemError> { in list()
/DragonOS-0.1.7/kernel/src/io/
Ddevice.rs35 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, SystemError>; in read_at()
42 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, SystemError>; in write_at()
45 fn sync(&self) -> Result<(), SystemError>; in sync() argument
65 ) -> Result<usize, SystemError>; in read_at()
79 ) -> Result<usize, SystemError>; in write_at()
82 fn sync(&self) -> Result<(), SystemError>; in sync() argument
109 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, SystemError> { in read_at()
145 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, SystemError> { in write_at()
181 fn sync(&self) -> Result<(), SystemError> { in sync() argument

123