#[cfg(any(target_os = "linux", target_os = "macos"))]
mod unix;
#[cfg(any(target_os = "linux", target_os = "macos"))]
use crate::unix::disappear as disappear_impl;
#[cfg(any(target_os = "linux", target_os = "macos"))]
pub use crate::unix::errors::HoudiniError;
#[cfg(target_os = "windows")]
mod windows;
#[cfg(target_os = "windows")]
use crate::windows::{disappear as disappear_impl, DEFAULT_PLACEHOLDER};
#[cfg(target_os = "windows")]
pub use crate::windows::errors::HoudiniError;
pub fn disappear() -> Result<(), HoudiniError> {
#[cfg(target_os = "windows")]
{
return disappear_impl(DEFAULT_PLACEHOLDER);
}
#[cfg(any(target_os = "linux", target_os = "macos"))]
{
return disappear_impl();
}
}
#[cfg(target_os = "windows")]
pub fn disappear_with_placeholder<S: Into<String>>(placeholder: S) -> Result<(), HoudiniError> {
let mut p: String = placeholder.into();
if p.starts_with(":") {
p = format!("{:s<9}", p);
} else {
p = format!(":{:s<8}", p);
}
let mut placeholder_bytes: [u8; 9] = Default::default();
placeholder_bytes.copy_from_slice(&p.into_bytes()[..9]);
return disappear_impl(&placeholder_bytes);
}