[−][src]Trait kul_core::TextConcat
A Text
that can logically concatenate its values,
optionally by using a provided DatumAllocator
.
Separating this concatenation functionality from the Text
trait avoids
difficulties that otherwise would happen with needing to have the DA: DatumAllocator
type parameter where not really needed.
The Datum
allocation support exists to support TextDatumList
,
but it hypothetically might be useful to other potential implementations.
The DA
type argument must be the same as that of the Parser
s
this is used with. When this is implemented for types that ignore the
DatumAllocator
, the DA
type should be a generic type parameter that
covers all (ignored) possibilities.
Required methods
fn concat(self, other: Self, datum_alloc: &mut DA) -> Result<Self, AllocError>
Concatenate two Text
s (of the same type) to form a single Text
that
logically represents this. The datum_alloc
argument may be ignored by
some (most) implementations and exists only to support implementations
like TextDatumList
. If the implementation ignores datum_alloc
, it
is safe to use unwrap
on the returned Result
.
Implementors
impl<'d, DA, C, ET> TextConcat<DA> for TextDatumList<'d, C, ET> where
C: TextChunk,
DA: DatumAllocator<TT = Self, ET = ET, DR = DatumMutRef<'d, Self, ET>>,
[src]
C: TextChunk,
DA: DatumAllocator<TT = Self, ET = ET, DR = DatumMutRef<'d, Self, ET>>,
Enables TextDatumList
to be used with Parser
s as the produced Datum
s'
text type. This can only be used with Parser
s that allocate the same type
of Datum
that Self
uses, which is required by this impl
's where
bounds.
fn concat(self, other: Self, datum_alloc: &mut DA) -> Result<Self, AllocError>
[src]
Link two TextDatumList
s to form a single TextDatumList
that
represents their logical concatenation. Unlike most implementations of
TextConcat
, this does use the datum_alloc
argument to allocate the
new Datum
s that are used as the storage of the nodes of our
linked-list approach.