INNER CODE UNIT · Rust

try_into

gfx-rs/gfx · src/auxil/external-memory/src/lib.rs:61

    fn try_into(self) -> Result<Fd, Self::Error>{
        match self {
            Self::Fd(fd)=>Ok(fd),
            #[cfg(windows)]
            Self::Handle(_)=>Err("PlatformMemory does not contain an fd"),
            Self::Ptr(_)=>Err("PlatformMemory does not contain an fd"),
        }
    }
}

#[cfg(any(windows, doc))]
impl std::convert::TryInto<Handle> for PlatformMemory{
    type Error = &'static str;
    fn try_into(self) -> Result<Handle, Self::Error>{
        match self {
            Self::Handle(handle)=>Ok(handle),
            #[cfg(unix)]
            Self::Fd(_)=>Err("PlatformMemory does not contain an handle"),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…