-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from jacobtread-contrib/fix-windows-builds
fix: update windows for new changes
- Loading branch information
Showing
16 changed files
with
617 additions
and
200 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//! Wrapper around signals for platforms that they are not supported on | ||
|
||
use std::{fmt::Display, str::FromStr}; | ||
|
||
#[cfg(unix)] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct KillportSignal(pub nix::sys::signal::Signal); | ||
|
||
/// On a platform where we don't have the proper signals enum | ||
#[cfg(not(unix))] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct KillportSignal(pub String); | ||
|
||
impl Display for KillportSignal { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
Display::fmt(&self.0, f) | ||
} | ||
} | ||
|
||
impl FromStr for KillportSignal { | ||
type Err = std::io::Error; | ||
|
||
fn from_str(value: &str) -> Result<Self, Self::Err> { | ||
#[cfg(unix)] | ||
{ | ||
let signal = nix::sys::signal::Signal::from_str(value)?; | ||
Ok(KillportSignal(signal)) | ||
} | ||
|
||
#[cfg(not(unix))] | ||
{ | ||
Ok(KillportSignal(value.to_string())) | ||
} | ||
} | ||
} |
Oops, something went wrong.