pub enum PortValue {
Features(OpaqueValue),
Raster(Arc<RasterBuf>),
Sprite(Arc<RasterBuf>),
Brush(OpaqueValue),
Labels(OpaqueValue),
Scalar(ScalarValue),
ScalarField(Arc<ScalarField>),
}Expand description
One value flowing along an edge. Cloning is cheap (Arc / Copy).
Variants§
Features(OpaqueValue)
Raster(Arc<RasterBuf>)
Sprite(Arc<RasterBuf>)
Brush(OpaqueValue)
Labels(OpaqueValue)
Label placement candidates or decisions (see PortKind::Labels).
Scalar(ScalarValue)
ScalarField(Arc<ScalarField>)
Implementations§
Source§impl PortValue
impl PortValue
pub fn kind(&self) -> PortKind
pub fn as_scalar_field(&self) -> Option<&Arc<ScalarField>>
pub fn as_raster(&self) -> Option<&Arc<RasterBuf>>
pub fn as_sprite(&self) -> Option<&Arc<RasterBuf>>
Sourcepub fn approx_bytes(&self) -> usize
pub fn approx_bytes(&self) -> usize
Approximate heap bytes held by this value’s payload.
Exact for the pixel-carrying variants (raster, sprite, scalar
field) — the ones that dominate render-time memory. Type-erased
payloads (features, brushes, labels) report 0 because their
concrete types live in other crates; treat the number as “bytes
in pixel buffers”, which is what memory reports care about.
The interned blank raster reports 0: it is one allocation shared
by every holder, so charging it per holder would badly overstate
what a render or a cache is really costing.
pub fn as_scalar(&self) -> Option<&ScalarValue>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PortValue
impl !UnwindSafe for PortValue
impl Freeze for PortValue
impl Send for PortValue
impl Sync for PortValue
impl Unpin for PortValue
impl UnsafeUnpin for PortValue
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
Mutably borrows from an owned value. Read more