@@ -12,6 +12,12 @@ newtype_enum! {
1212/// enum, as injecting an unknown value in a Rust enum is undefined behaviour.
1313///
1414/// For lack of a better option, we therefore model them as a newtype of usize.
15+ ///
16+ /// For a convenient integration into the Rust ecosystem, there are multiple
17+ /// factory methods to convert a Status into a [`uefi::Result`]:
18+ /// - [`Status::into_with`]
19+ /// - [`Status::into_with_val`]
20+ /// - [`Status::into_with_err`]
1521 #[ must_use]
1622pub enum Status : usize => {
1723 /// The operation completed successfully.
@@ -122,7 +128,10 @@ impl Status {
122128 self . 0 & ERROR_BIT != 0
123129 }
124130
125- /// Converts this status code into a result with a given value.
131+ /// Converts this status code into a [`uefi::Result`] with a given `Ok` value.
132+ ///
133+ /// If the status does not indicate success, the status representing the specific error
134+ /// code is embedded into the `Err` variant of type [`uefi::Error`].
126135 #[ inline]
127136 pub fn into_with_val < T > ( self , val : impl FnOnce ( ) -> T ) -> Result < T , ( ) > {
128137 if self . is_success ( ) {
@@ -132,7 +141,10 @@ impl Status {
132141 }
133142 }
134143
135- /// Converts this status code into a result with a given error payload
144+ /// Converts this status code into a [`uefi::Result`] with a given `Err` payload.
145+ ///
146+ /// If the status does not indicate success, the status representing the specific error
147+ /// code is embedded into the `Err` variant of type [`uefi::Error`].
136148 #[ inline]
137149 pub fn into_with_err < ErrData : Debug > (
138150 self ,
@@ -145,7 +157,10 @@ impl Status {
145157 }
146158 }
147159
148- /// Convert this status code into a result with a given value and error payload
160+ /// Convert this status code into a result with a given `Ok` value and `Err` payload.
161+ ///
162+ /// If the status does not indicate success, the status representing the specific error
163+ /// code is embedded into the `Err` variant of type [`uefi::Error`].
149164 #[ inline]
150165 pub fn into_with < T , ErrData : Debug > (
151166 self ,
0 commit comments