Echo Writes Code

windows.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::file_ext::{ FileExt };

use std::os::fd::{ AsRawHandle };

impl FileExt for File {
	type LockGuard = LockGuard;

	fn lock_shared(&self) -> Result<Self::LockGuard> {
		lock_shared(self.as_raw_handle())
	}

	fn lock_exclusive(&self) -> Result<Self::LockGuard> {
		lock_exclusive(self.as_raw_handle())
	}

	fn try_lock_shared(&self) -> Result<Self::LockGuard> {
		try_lock_shared(self.as_raw_handle())
	}

	fn try_lock_exclusive(&self) -> Result<Self::LockGuard> {
		try_lock_exclusive(self.as_raw_handle())
	}
}