#[stable(feature = "rust1", since = "1.0.0")]

pub fn stdin() -> Stdin {

static INSTANCE: Lazy>>> = Lazy::new(stdin_init);

return Stdin {

inner: INSTANCE.get().expect("cannot access stdin during shutdown"),

};


fn stdin_init() -> Arc>>> {

let stdin = match stdin_raw() {

Ok(stdin) => Maybe::Real(stdin),

_ => Maybe::Fake

};


Arc::new(Mutex::new(BufReader::with_capacity(stdio::STDIN_BUF_SIZE, stdin)))

}

}


아직 synchronization 쪽은 보지도 못했는데 이 쪽으로 가면 type 이름 점점 산으로 가는 느낌


어제는 Ownership 봤는데, 에서 Cow, ToOwned, Borrow 이런 거 까다롭네요.


(수정) 디시 마크다운 지원해줫으면