Trait swipl::blob::CloneBlobImpl
source · pub trait CloneBlobImpl: CloneBlobBase + Sized + Sync + Clone {
// Provided methods
fn compare(&self, _other: &Self) -> Ordering { ... }
fn write(&self, stream: &mut PrologStream) -> Result<()> { ... }
}
Expand description
Supertype of CloneBlob that allows implementation of compare
and write
.
When defining a CloneBlob through the clone_blob! attribute macro without the ‘defaults’ argument, you’re required to implement this trait for your type. This allows you to modify how comparison and writing will happen.
Provided Methods§
sourcefn compare(&self, _other: &Self) -> Ordering
fn compare(&self, _other: &Self) -> Ordering
Compare two values, returning an Ordering.
This is used from SWI-Prolog when sorting lists. The default
implementation returns Ordering::Equal
, effectively
providing no sorting information.
sourcefn write(&self, stream: &mut PrologStream) -> Result<()>
fn write(&self, stream: &mut PrologStream) -> Result<()>
Object Safety§
This trait is not object safe.