Rename ElementEdge to ElementInput

This commit is contained in:
Dennis Kobert
2026-09-06 15:13:32 +00:00
parent a16a4c6354
commit d80651e85c
3 changed files with 7 additions and 7 deletions

View File

@@ -216,7 +216,7 @@ unsafe fn element_only<El: Clone>(rec: Rec<'_>, _reads: &[Option<usize>]) -> El
unsafe { read_element::<El>(rec) }
}
pub struct ElementEdge<'a, 'e, Out, N> {
pub struct ElementInput<'a, 'e, Out, N> {
node: &'a N,
layout: &'a Layout,
reads: &'a [Option<usize>],
@@ -224,7 +224,7 @@ pub struct ElementEdge<'a, 'e, Out, N> {
frames: &'a Frames<'e>,
}
impl<'a, 'e, El: Clone, N> ElementEdge<'a, 'e, El, N> {
impl<'a, 'e, El: Clone, N> ElementInput<'a, 'e, El, N> {
pub fn new(node: &'a N, layout: &'a Layout, frames: &'a Frames<'e>) -> Self {
Self {
node,
@@ -236,7 +236,7 @@ impl<'a, 'e, El: Clone, N> ElementEdge<'a, 'e, El, N> {
}
}
impl<'a, 'e, Out, N> ElementEdge<'a, 'e, Out, N> {
impl<'a, 'e, Out, N> ElementInput<'a, 'e, Out, N> {
/// `read` must be sound against the layout the offsets in `reads` were
/// resolved from; the macro proves both at wiring.
pub fn with_reads(node: &'a N, layout: &'a Layout, reads: &'a [Option<usize>], read: unsafe fn(Rec<'_>, &[Option<usize>]) -> Out, frames: &'a Frames<'e>) -> Self {

View File

@@ -23,7 +23,7 @@ mod testkit;
pub use access::{Rec, RecordValue, apply_plan, borrow_element, erase_static, read_at, read_element, token_only, write_element, write_element_sized, write_field};
pub use frames::{FrameArena, FrameScope, Frames};
pub use input::{DerivedLazyInput, DerivedRecordInput, ElementEdge, ElementLazyInput, LevelStatus, RecordExtract, RecordInput, RecordLazyInput, fill_frames, materialize_batch, materialize_level};
pub use input::{DerivedLazyInput, DerivedRecordInput, ElementInput, ElementLazyInput, LevelStatus, RecordExtract, RecordInput, RecordLazyInput, fill_frames, materialize_batch, materialize_level};
pub use layout::{
ElToken, ElementSpec, ElementWrite, ElementWritePick, ElementWritePickHashed, ElementWritePickPlain, FieldDesc, FieldOffset, FieldWrite, InputReads, Layout, LayoutMeta, RecordLayout, copy_plan,
element_dims, element_parked, element_write, element_write_hashed, empty_layout,

View File

@@ -1135,7 +1135,7 @@ pub(crate) fn generate_node_impl(crate_ident: &CrateIdent, parsed: &ParsedNodeFn
(LazyBinding::OpaqueRecord, _) => quote!(#pat: &#core_types::record::RecordInput<'_, #frames_lifetime, #source_generic>),
(LazyBinding::Element, true) => {
let out = lazy_read_out(field, output_type);
quote!(#pat: &#core_types::record::ElementEdge<'_, #frames_lifetime, #out, #source_generic>)
quote!(#pat: &#core_types::record::ElementInput<'_, #frames_lifetime, #out, #source_generic>)
}
(LazyBinding::Element, false) => {
let out = lazy_read_out(field, output_type);
@@ -1457,13 +1457,13 @@ pub(crate) fn generate_node_impl(crate_ident: &CrateIdent, parsed: &ParsedNodeFn
let slot = format_ident!("__in_{index}");
match field.attribute_reads.is_empty() {
true => quote! {
let #name = #core_types::record::ElementEdge::<#output_type, _>::new(&self.#name, &self.#slot, &__lazy_frames);
let #name = #core_types::record::ElementInput::<#output_type, _>::new(&self.#name, &self.#slot, &__lazy_frames);
},
false => {
let arr = format_ident!("__reads_{index}");
let read_fn = format_ident!("__{}_read_{}", fn_name, index);
quote! {
let #name = #core_types::record::ElementEdge::with_reads(&self.#name, &self.#slot, &self.#arr, self::#read_fn, &__lazy_frames);
let #name = #core_types::record::ElementInput::with_reads(&self.#name, &self.#slot, &self.#arr, self::#read_fn, &__lazy_frames);
}
}
}