Enum xous::definitions::Result

source ·
#[repr(C)]
pub enum Result {
Show 23 variants Ok, Error(Error), MemoryAddress(MemoryAddress), MemoryRange(MemoryRange), ReadyThreads(usize, usize, usize, usize, usize, usize, usize), ResumeProcess, ServerID(SID), ConnectionID(CID), NewServerID(SID, CID), MessageEnvelope(MessageEnvelope), ThreadID(TID), ProcessID(PID), Unimplemented, BlockedProcess, Scalar1(usize), Scalar2(usize, usize), RetryCall, None, MemoryReturned(Option<MemorySize>, Option<MemorySize>), NewProcess(ProcessStartup), Scalar5(usize, usize, usize, usize, usize), Message(Message), UnknownResult(usize, usize, usize, usize, usize, usize, usize),
}

Variants§

§

Ok

0

§

Error(Error)

1

§

MemoryAddress(MemoryAddress)

2

§

MemoryRange(MemoryRange)

3

§

ReadyThreads(usize, usize, usize, usize, usize, usize, usize)

4

§

ResumeProcess

5

§

ServerID(SID)

6

§

ConnectionID(CID)

7

§

NewServerID(SID, CID)

8

§

MessageEnvelope(MessageEnvelope)

9

§

ThreadID(TID)

10

§

ProcessID(PID)

11

§

Unimplemented

12: The requested system call is unimplemented

§

BlockedProcess

13: The process is blocked and should perform the read() again. This is only ever seen in Hosted mode, because when running natively the kernel simply never schedules the process.

§

Scalar1(usize)

14: A scalar with one value

§

Scalar2(usize, usize)

15: A scalar with two values

§

RetryCall

16: The syscall should be attempted again. This is returned when calling functions such as try_connect() and try_send() that may block.

§

None

The message was successful but no value was returned.

§

MemoryReturned(Option<MemorySize>, Option<MemorySize>)

Memory was returned, and more information is available.

§

NewProcess(ProcessStartup)

Returned when a process has started. This describes the new process to the caller.

§

Scalar5(usize, usize, usize, usize, usize)

20: A scalar with five values

§

Message(Message)

21: A message is returned as part of send_message() when the result is blocking

§

UnknownResult(usize, usize, usize, usize, usize, usize, usize)

Reserved: do not rely on the argument numbering for this variant.

Implementations§

source§

impl Result

source

pub fn to_args(&self) -> [usize; 8]

source

pub fn from_args(src: [usize; 8]) -> Self

source

pub fn memory(&self) -> Option<&MemoryRange>

If the Result has memory attached to it, return the memory

Trait Implementations§

source§

impl Debug for Result

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Error> for Result

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Result

source§

fn eq(&self, other: &Result) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Result

Auto Trait Implementations§

§

impl Freeze for Result

§

impl RefUnwindSafe for Result

§

impl Send for Result

§

impl Sync for Result

§

impl Unpin for Result

§

impl UnwindSafe for Result

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.