INNER CODE UNIT · Rust
ptr
gfx-rs/gfx · src/auxil/external-memory/src/lib.rs:47
pub fn ptr(&self)->Option<&Ptr> {
match self {
Self::Ptr(ptr)=>Some(ptr),
#[cfg(unix)]
Self::Fd(_)=>None,
#[cfg(windows)]
Self::Handle(_)=>None
}
}
}
#[cfg(any(unix, doc))]
impl std::convert::TryInto<Fd> for PlatformMemory{
type Error = &'static str;
fn try_into(self) -> Result<Fd, Self::Error>{
match self {
Self::Fd(fd)=>Ok(fd),
#[cfg(windows)]