Materialize the `Constant`. If this entry was built via [`Self::from_constant`], returns the pre-populated cached `Arc` (zero-cost clone). Otherwise parses fresh from `bytes` on every call and returns a new `Arc` without storing it — see the module-level "Cache policy" docs for why.
(&self)
| 148 | /// one hash per entry per load, not per call). Used by |
| 149 | /// `Env::get_anon` so env parse time does not pay one content hash |
| 150 | /// per constant. |
| 151 | pub fn from_bytes_deferred(bytes: Arc<[u8]>, addr: Address) -> Self { |
| 152 | LazyConstant { |
| 153 | bytes: BytesSource::Heap(bytes), |
| 154 | cache: None, |
| 155 | pending_addr: Some(addr), |
| 156 | verified: Arc::new(AtomicBool::new(false)), |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | /// Construct from a memory-mapped window. The `Arc<Mmap>` keeps |
| 161 | /// the underlying mapping alive; cloning the `LazyConstant` only |
| 162 | /// bumps the refcount. |
| 163 | /// |
| 164 | /// Used by `Env::get_anon_mmap` to avoid heap-copying the on-disk |
| 165 | /// byte stream — the OS page cache is the source of truth. |
| 166 | pub fn from_mmap_slice(mmap: Arc<Mmap>, offset: usize, len: usize) -> Self { |
| 167 | LazyConstant { |