pub struct JoinCx<'a> { /* private fields */ }Expand description
The context with which a within-joiner builds content: an ancestor’s number, the parts written before an ancestor, and text of its own.
Everything a reader sees is content, not characters, and a within-joiner builds content only through this context.
Implementations§
Source§impl<'a> JoinCx<'a>
impl<'a> JoinCx<'a>
Sourcepub fn number_of(
&self,
ancestor: &Ancestor,
) -> Result<Arc<NodeTree<Flm>>, FormatError>
pub fn number_of( &self, ancestor: &Ancestor, ) -> Result<Arc<NodeTree<Flm>>, FormatError>
Returns ancestor’s own number, written in its own counter style: the
number alone, with no word, no delimiters and nothing of its own
ancestors.
§Errors
FormatError when the content could not be built, and
FormatError::UndeclaredSubLevel when the value carries a sub-number
for which the counter style declares no format.
Sourcepub fn number_of_in(
&self,
ancestor: &Ancestor,
format: NumberFormat,
) -> Result<Arc<NodeTree<Flm>>, FormatError>
pub fn number_of_in( &self, ancestor: &Ancestor, format: NumberFormat, ) -> Result<Arc<NodeTree<Flm>>, FormatError>
Sourcepub fn parts_before(
&self,
ancestors: &[Ancestor],
index: usize,
) -> Result<Vec<Part>, FormatError>
pub fn parts_before( &self, ancestors: &[Ancestor], index: usize, ) -> Result<Vec<Part>, FormatError>
Returns the parts written before ancestors[index]: what that
ancestor’s own within-joiner writes of the ancestors before it. An
ancestor numbered within nothing has no part.
Through this recursion, a within-joiner that refers to the counter immediately above writes the whole chain: each step has strictly fewer ancestors before it than the step before, so the writing always ends.
§Errors
The error the ancestor’s own within-joiner returns.
Sourcepub fn literal(&self, text: &str) -> Result<Arc<NodeTree<Flm>>, FormatError>
pub fn literal(&self, text: &str) -> Result<Arc<NodeTree<Flm>>, FormatError>
Returns text as a small tree of content, built as the characters of
a number are: one text node attributed to the counter style’s source.
§Errors
FormatError when the content could not be built.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for JoinCx<'a>
impl<'a> !UnwindSafe for JoinCx<'a>
impl<'a> Forget for JoinCx<'a>
impl<'a> Freeze for JoinCx<'a>where
&'a CounterStyle: Freeze,
impl<'a> Move for JoinCx<'a>
impl<'a> Send for JoinCx<'a>where
&'a CounterStyle: Send,
impl<'a> Sync for JoinCx<'a>where
Arc<str>: Sync,
RawVecInner: Sync,
Arc<NodeTree<Flm>>: Sync,
Arc<Source<FlmOrigin>>: Sync,
NodeRef<Owned, NodeId, PlaceholderRef, LeafOrInternal>: Sync,
BoxRaw<(NodeId, PlaceholderRef)>: Sync,
BoxRaw<dyn DiagnosticData>: Sync,
Arc<Vec<CompiledSubLevel>>: Sync,
Arc<CompiledWords>: Sync,
Arc<CompiledJoin>: Sync,
Arc<dyn CompiledNumberWriter>: Sync,
Arc<ParsingState<Flm>>: Sync,
impl<'a> Unpin for JoinCx<'a>where
&'a CounterStyle: Unpin,
impl<'a> UnsafeUnpin for JoinCx<'a>where
&'a CounterStyle: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more