Lines Matching refs:ErrorCode

5     self, ErrorCode, HostDescriptor, HostDirectoryEntryStream,
22 fn convert_error_code(&mut self, err: FsError) -> wasmtime::Result<ErrorCode> { in convert_error_code() argument
29 ) -> wasmtime::Result<Option<ErrorCode>> { in filesystem_error_code() argument
35 return Ok(Some(ErrorCode::from(err))); in filesystem_error_code()
113 return Err(ErrorCode::NotPermitted.into()); in read()
150 return Err(ErrorCode::NotPermitted.into()); in write()
166 return Err(ErrorCode::NotPermitted.into()); in read_directory()
219 Err(ReaddirError::IllegalSequence) => Err(ErrorCode::IllegalByteSequence.into()), in read_directory()
385 Err(types::ErrorCode::BadDescriptor)?; in read_via_stream()
406 Err(types::ErrorCode::BadDescriptor)?; in write_via_stream()
427 Err(types::ErrorCode::BadDescriptor)?; in append_via_stream()
585 type Error = ErrorCode;
596 ) -> Result<Self, ErrorCode> {
624 fn from_raw_os_error(err: Option<i32>) -> Option<ErrorCode> { in from_raw_os_error() argument
630 RustixErrno::PIPE => ErrorCode::Pipe, in from_raw_os_error()
631 RustixErrno::PERM => ErrorCode::NotPermitted, in from_raw_os_error()
632 RustixErrno::NOENT => ErrorCode::NoEntry, in from_raw_os_error()
633 RustixErrno::NOMEM => ErrorCode::InsufficientMemory, in from_raw_os_error()
634 RustixErrno::IO => ErrorCode::Io, in from_raw_os_error()
635 RustixErrno::BADF => ErrorCode::BadDescriptor, in from_raw_os_error()
636 RustixErrno::BUSY => ErrorCode::Busy, in from_raw_os_error()
637 RustixErrno::ACCESS => ErrorCode::Access, in from_raw_os_error()
638 RustixErrno::NOTDIR => ErrorCode::NotDirectory, in from_raw_os_error()
639 RustixErrno::ISDIR => ErrorCode::IsDirectory, in from_raw_os_error()
640 RustixErrno::INVAL => ErrorCode::Invalid, in from_raw_os_error()
641 RustixErrno::EXIST => ErrorCode::Exist, in from_raw_os_error()
642 RustixErrno::FBIG => ErrorCode::FileTooLarge, in from_raw_os_error()
643 RustixErrno::NOSPC => ErrorCode::InsufficientSpace, in from_raw_os_error()
644 RustixErrno::SPIPE => ErrorCode::InvalidSeek, in from_raw_os_error()
645 RustixErrno::MLINK => ErrorCode::TooManyLinks, in from_raw_os_error()
646 RustixErrno::NAMETOOLONG => ErrorCode::NameTooLong, in from_raw_os_error()
647 RustixErrno::NOTEMPTY => ErrorCode::NotEmpty, in from_raw_os_error()
648 RustixErrno::LOOP => ErrorCode::Loop, in from_raw_os_error()
649 RustixErrno::OVERFLOW => ErrorCode::Overflow, in from_raw_os_error()
650 RustixErrno::ILSEQ => ErrorCode::IllegalByteSequence, in from_raw_os_error()
651 RustixErrno::NOTSUP => ErrorCode::Unsupported, in from_raw_os_error()
652 RustixErrno::ALREADY => ErrorCode::Already, in from_raw_os_error()
653 RustixErrno::INPROGRESS => ErrorCode::InProgress, in from_raw_os_error()
654 RustixErrno::INTR => ErrorCode::Interrupted, in from_raw_os_error()
660 RustixErrno::OPNOTSUPP => ErrorCode::Unsupported, in from_raw_os_error()
666 fn from_raw_os_error(raw_os_error: Option<i32>) -> Option<ErrorCode> { in from_raw_os_error() argument
669 Some(Foundation::ERROR_FILE_NOT_FOUND) => ErrorCode::NoEntry, in from_raw_os_error()
670 Some(Foundation::ERROR_PATH_NOT_FOUND) => ErrorCode::NoEntry, in from_raw_os_error()
671 Some(Foundation::ERROR_ACCESS_DENIED) => ErrorCode::Access, in from_raw_os_error()
672 Some(Foundation::ERROR_SHARING_VIOLATION) => ErrorCode::Access, in from_raw_os_error()
673 Some(Foundation::ERROR_PRIVILEGE_NOT_HELD) => ErrorCode::NotPermitted, in from_raw_os_error()
674 Some(Foundation::ERROR_INVALID_HANDLE) => ErrorCode::BadDescriptor, in from_raw_os_error()
675 Some(Foundation::ERROR_INVALID_NAME) => ErrorCode::NoEntry, in from_raw_os_error()
676 Some(Foundation::ERROR_NOT_ENOUGH_MEMORY) => ErrorCode::InsufficientMemory, in from_raw_os_error()
677 Some(Foundation::ERROR_OUTOFMEMORY) => ErrorCode::InsufficientMemory, in from_raw_os_error()
678 Some(Foundation::ERROR_DIR_NOT_EMPTY) => ErrorCode::NotEmpty, in from_raw_os_error()
679 Some(Foundation::ERROR_NOT_READY) => ErrorCode::Busy, in from_raw_os_error()
680 Some(Foundation::ERROR_BUSY) => ErrorCode::Busy, in from_raw_os_error()
681 Some(Foundation::ERROR_NOT_SUPPORTED) => ErrorCode::Unsupported, in from_raw_os_error()
682 Some(Foundation::ERROR_FILE_EXISTS) => ErrorCode::Exist, in from_raw_os_error()
683 Some(Foundation::ERROR_BROKEN_PIPE) => ErrorCode::Pipe, in from_raw_os_error()
684 Some(Foundation::ERROR_BUFFER_OVERFLOW) => ErrorCode::NameTooLong, in from_raw_os_error()
685 Some(Foundation::ERROR_NOT_A_REPARSE_POINT) => ErrorCode::Invalid, in from_raw_os_error()
686 Some(Foundation::ERROR_NEGATIVE_SEEK) => ErrorCode::Invalid, in from_raw_os_error()
687 Some(Foundation::ERROR_DIRECTORY) => ErrorCode::NotDirectory, in from_raw_os_error()
688 Some(Foundation::ERROR_ALREADY_EXISTS) => ErrorCode::Exist, in from_raw_os_error()
689 Some(Foundation::ERROR_STOPPED_ON_SYMLINK) => ErrorCode::Loop, in from_raw_os_error()
690 Some(Foundation::ERROR_DIRECTORY_NOT_SUPPORTED) => ErrorCode::IsDirectory, in from_raw_os_error()
695 impl From<std::io::Error> for ErrorCode { implementation
696 fn from(err: std::io::Error) -> ErrorCode { in from() argument
697 ErrorCode::from(&err) in from()
701 impl<'a> From<&'a std::io::Error> for ErrorCode { implementation
702 fn from(err: &'a std::io::Error) -> ErrorCode { in from() argument
708 std::io::ErrorKind::NotFound => ErrorCode::NoEntry, in from()
709 std::io::ErrorKind::PermissionDenied => ErrorCode::NotPermitted, in from()
710 std::io::ErrorKind::AlreadyExists => ErrorCode::Exist, in from()
711 std::io::ErrorKind::InvalidInput => ErrorCode::Invalid, in from()
712 _ => ErrorCode::Io, in from()
719 impl From<cap_rand::Error> for ErrorCode { implementation
720 fn from(err: cap_rand::Error) -> ErrorCode { in from() argument
722 from_raw_os_error(err.raw_os_error()).unwrap_or(ErrorCode::Io) in from()
726 impl From<std::num::TryFromIntError> for ErrorCode { implementation
727 fn from(_err: std::num::TryFromIntError) -> ErrorCode { in from() argument
728 ErrorCode::Overflow in from()
750 fn systemtime_from(t: wall_clock::Datetime) -> Result<std::time::SystemTime, ErrorCode> { in systemtime_from() argument
753 .ok_or(ErrorCode::Overflow) in systemtime_from()
758 ) -> Result<Option<fs_set_times::SystemTimeSpec>, ErrorCode> { in systemtimespec_from() argument
770 impl From<crate::clocks::DatetimeError> for ErrorCode { implementation
771 fn from(_: crate::clocks::DatetimeError) -> ErrorCode { in from() argument
772 ErrorCode::Overflow in from()