Re:Asterinas: OS kernel written in Rust and providing Linux-...
by oniony on Wednesday October 16, 2024 @10:45AM
(#41859658)
Result is whether an operation returned an error or not. Option is whether you have a value or no value.
[ Parent
| on HN ]
Re:Asterinas: OS kernel written in Rust and providing Linux-...
by thesuperbigfrog on Wednesday October 16, 2024 @11:31AM
(#41860266)
Exactly.
That is why a query that successfully returns no items can be represented as Ok(None).
A successful query with items returned would instead be Ok(Vec<Item>).
An error in the completing the query (for example, problem with the database), would be Err(DatabaseError) or Err(SomeOtherError).