mod private
{
use crate::*;
pub use super::
{
aref::{ Ref, Ref2, Ref3 },
};
use std::
{
borrow::Cow,
};
pub trait ToStringWithFallback< 'a, How, Fallback1, Fallback2 >
where
How : 'static,
Fallback1 : 'static,
Fallback2 : 'static,
{
fn to_string_with_fallback( self ) -> Cow< 'a, str >
;
}
impl< 'a, T, How, Fallback1, Fallback2 > ToStringWithFallback< 'a, How, Fallback1, Fallback2 >
for Ref< 'a, T, How, Fallback1, Fallback2 >
where
T : ToStringWith< How > + ?Sized,
How : 'static,
Fallback1 : 'static,
Fallback2 : 'static,
{
#[ inline ]
fn to_string_with_fallback( self ) -> Cow< 'a, str >
where
{
self.0.0.0.to_string_with()
}
}
impl< 'a, T, How, Fallback1, Fallback2 > ToStringWithFallback< 'a, How, Fallback1, Fallback2 >
for Ref2< 'a, T, How, Fallback1, Fallback2 >
where
T : ToStringWith< Fallback1 > + ?Sized,
How : 'static,
Fallback1 : 'static,
Fallback2 : 'static,
{
#[ inline ]
fn to_string_with_fallback( self ) -> Cow< 'a, str >
{
self.0.0.to_string_with()
}
}
impl< 'a, T, How, Fallback1, Fallback2 > ToStringWithFallback< 'a, How, Fallback1, Fallback2 >
for Ref3< 'a, T, How, Fallback1, Fallback2 >
where
T : ToStringWith< Fallback2 > + ?Sized,
How : 'static,
Fallback1 : 'static,
Fallback2 : 'static,
{
#[ inline ]
fn to_string_with_fallback( self ) -> Cow< 'a, str >
{
self.0.to_string_with()
}
}
#[ macro_export ]
macro_rules! to_string_with_fallback
{
( $how : ty, $fallback1 : ty, $src : expr )
=>
{{
use $crate::ToStringWithFallback;
$crate
::to_string_with_fallback
::Ref
::< '_, _, $how, $fallback1, $fallback1 >
::from( $src )
.to_string_with_fallback()
}};
( $how : ty, $fallback1 : ty, $fallback2 : ty, $src : expr )
=>
{{
use $crate::ToStringWithFallback;
$crate
::to_string_with_fallback
::Ref
::< '_, _, $how, $fallback1, $fallback2 >
::from( $src )
.to_string_with_fallback()
}};
}
pub use to_string_with_fallback;
}
mod aref;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use own::*;
#[ allow( unused_imports ) ]
pub mod own
{
use super::*;
#[ doc( inline ) ]
pub use orphan::*;
#[ doc( inline ) ]
pub use private::
{
Ref,
Ref2,
Ref3,
to_string_with_fallback,
};
}
#[ allow( unused_imports ) ]
pub mod orphan
{
use super::*;
pub use super::super::to_string_with_fallback;
#[ doc( inline ) ]
pub use exposed::*;
#[ doc( inline ) ]
pub use private::
{
ToStringWithFallback,
};
}
#[ allow( unused_imports ) ]
pub mod exposed
{
use super::*;
#[ doc( inline ) ]
pub use prelude::*;
#[ doc( inline ) ]
pub use private::
{
};
}
#[ allow( unused_imports ) ]
pub mod prelude
{
use super::*;
}