use crate::std::string::String;
use crate::std::vec::Vec;
use rama_core::bytes::Bytes;
mod sealed {
use super::Bytes;
pub trait Sealed {
fn into_uri_input(self) -> Bytes;
}
}
pub trait IntoUriInput: sealed::Sealed {}
impl sealed::Sealed for Bytes {
#[inline(always)]
fn into_uri_input(self) -> Bytes {
self
}
}
impl IntoUriInput for Bytes {}
impl sealed::Sealed for String {
#[inline(always)]
fn into_uri_input(self) -> Bytes {
Bytes::from(self)
}
}
impl IntoUriInput for String {}
impl sealed::Sealed for Vec<u8> {
#[inline(always)]
fn into_uri_input(self) -> Bytes {
Bytes::from(self)
}
}
impl IntoUriInput for Vec<u8> {}
impl sealed::Sealed for &str {
#[inline(always)]
fn into_uri_input(self) -> Bytes {
Bytes::copy_from_slice(self.as_bytes())
}
}
impl IntoUriInput for &str {}
impl sealed::Sealed for &[u8] {
#[inline(always)]
fn into_uri_input(self) -> Bytes {
Bytes::copy_from_slice(self)
}
}
impl IntoUriInput for &[u8] {}
#[inline(always)]
pub(crate) fn into_uri_input<T: IntoUriInput>(input: T) -> Bytes {
<T as sealed::Sealed>::into_uri_input(input)
}