INNER CODE UNIT · Rust
from
tensorflow/rust · src/lib.rs:562
fn from(e: IntoStringError) -> Self {
invalid_arg!("Error converting C string to Rust string: {}", e)
}
}
impl From<ParseIntError> for Status {
fn from(e: ParseIntError) -> Self {
invalid_arg!("Error parsing an integer: {}", e)
}
}
impl Error for Status {
fn description(&self) -> &str {
unsafe {
match CStr::from_ptr(tf::TF_Message(self.inner)).to_str() {
Ok(s) => s,
Err(_) => "<invalid UTF-8 in message>",
}