-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(agent): initial DVC server implementation (#1053)
- Loading branch information
1 parent
5fa998e
commit caa5ffa
Showing
32 changed files
with
2,410 additions
and
288 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
4 changes: 1 addition & 3 deletions
4
crates/devolutions-pedm-shared/devolutions-pedm-client-http/src/apis/mod.rs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
use http; | ||
use hyper; | ||
use serde_json; | ||
use {http, hyper, serde_json}; | ||
|
||
#[derive(Debug)] | ||
pub enum Error { | ||
|
5 changes: 1 addition & 4 deletions
5
crates/devolutions-pedm-shared/devolutions-pedm-client-http/src/apis/request.rs
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use std::sync::Arc; | ||
|
||
use windows::Win32::Foundation::HANDLE; | ||
use windows::Win32::System::Threading::{CreateEventW, SetEvent}; | ||
|
||
use crate::handle::Handle; | ||
|
||
/// RAII wrapper for WinAPI event handle. | ||
#[derive(Debug, Clone)] | ||
pub struct Event { | ||
handle: Arc<Handle>, | ||
} | ||
|
||
impl Event { | ||
pub fn new_unnamed() -> anyhow::Result<Self> { | ||
// SAFETY: No preconditions. | ||
let raw_handle = unsafe { CreateEventW(None, false, false, None) }?; | ||
|
||
// SAFETY: `CreateEventW` always returns a valid handle on success. | ||
let handle = unsafe { Handle::new_owned(raw_handle) }?; | ||
|
||
Ok(Self { | ||
handle: Arc::new(handle), | ||
}) | ||
} | ||
|
||
pub fn raw(&self) -> HANDLE { | ||
self.handle.raw() | ||
} | ||
|
||
pub fn set(&self) -> anyhow::Result<()> { | ||
// SAFETY: No preconditions. | ||
unsafe { | ||
SetEvent(self.handle.raw())?; | ||
} | ||
Ok(()) | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.