This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(generic_associated_types)] | |
use std::{cell::UnsafeCell, marker::PhantomData}; | |
//// | |
// GAT-esque Deref and DerefMut | |
pub trait Deref<T> { | |
type Ref<'a> | |
where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(incomplete_features)] | |
#![feature(adt_const_params, specialization)] | |
use std::{ | |
any::{Any, TypeId}, | |
cell::UnsafeCell, | |
collections::HashMap, | |
marker::PhantomData, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: Make this a named type/remove dyn | |
type SemaphoreFut = Pin<Box<dyn Future<Output = Result<OwnedSemaphorePermit, AcquireError>>>>; | |
#[pin_project(project_replace = StateReplaceProj, project = StateProj)] | |
enum State { | |
Pending(#[pin] SemaphoreFut), | |
Done(OwnedSemaphorePermit), | |
} | |
#[pin_project] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// HMS-Oxide floats motionless, shimmering in a sunbeam, above... | |
pub struct Spacecraft; | |
/// ...the cool blue ocean planet. | |
pub struct OceanPlanet; | |
/// Every hospitable planet has to have a layer of Atmosphere... | |
pub struct Atmosphere<Altitude>(Altitude); | |
impl OceanPlanet { |