Rename struct

This commit is contained in:
jD91mZM2
2018-06-02 18:07:18 +02:00
parent 34e82a7235
commit 6f362b4548
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ use syscall::SchemeBlockMut;
mod scheme;
use scheme::ChanScheme;
use scheme::IpcScheme;
fn from_syscall_error(error: syscall::Error) -> io::Error {
io::Error::from_raw_os_error(error.errno as i32)
@@ -21,7 +21,7 @@ fn main() -> Result<(), Box<::std::error::Error>> {
}
let mut scheme_file = File::create(":chan")?;
let mut scheme = ChanScheme::default();
let mut scheme = IpcScheme::default();
let mut todo = VecDeque::with_capacity(16);
+3 -3
View File
@@ -48,12 +48,12 @@ impl Handle {
}
#[derive(Default)]
pub struct ChanScheme {
pub struct IpcScheme {
handles: BTreeMap<usize, Handle>,
listeners: BTreeMap<String, usize>,
next_id: usize
}
impl ChanScheme {
impl IpcScheme {
pub fn post_fevents(&mut self, file: &mut File) -> io::Result<()> {
for (id, handle) in &mut self.handles {
if handle.is_listener() {
@@ -86,7 +86,7 @@ impl ChanScheme {
Ok(())
}
}
impl SchemeBlockMut for ChanScheme {
impl SchemeBlockMut for IpcScheme {
fn open(&mut self, path: &[u8], flags: usize, _uid: u32, _gid: u32) -> Result<Option<usize>> {
let path = ::std::str::from_utf8(path).or(Err(Error::new(EPERM)))?;