Skip to main content

StrykeValue

Struct StrykeValue 

Source
pub struct StrykeValue(/* private fields */);
Expand description

NaN-boxed value: one u64 (immediates, raw float bits, or tagged heap pointer).

Implementationsยง

Sourceยง

impl StrykeValue

Source

pub fn dup_stack(&self) -> Self

Stack duplicate (Op::Dup): share the outer heap Arc for arrays/hashes (COW on write), matching Perl temporaries; other heap payloads keep Clone semantics.

Source

pub fn shallow_clone(&self) -> Self

Refcount-only clone: Arc::clone the heap pointer (no deep copy of the payload).

Use this when producing a second handle to the same value that the caller will read-only or consume via Self::into_string / Arc::try_unwrap-style uniqueness checks. Cheap O(1) regardless of the payload size.

The default Clone impl deep-copies String/Array/Hash payloads to preserve โ€œclone = independent writable valueโ€ semantics for legacy callers; in hot RMW paths (.=, slot stash-and-return) that deep copy is O(N) and must be avoided โ€” use this instead.

Sourceยง

impl StrykeValue

Source

pub const UNDEF: StrykeValue

Source

pub fn is_integer_like(&self) -> bool

typed : Int โ€” inline i32 or heap i64.

Source

pub fn is_float_like(&self) -> bool

Raw f64 bits or heap boxed float (NaN/Inf).

Source

pub fn is_string_like(&self) -> bool

Heap UTF-8 string only.

Source

pub fn integer(n: i64) -> Self

Source

pub fn bigint(n: BigInt) -> Self

Wrap a BigInt. If it fits in i64, demotes to a regular integer so downstream consumers donโ€™t have to special-case BigInt for small values.

Source

pub fn as_bigint(&self) -> Option<Arc<BigInt>>

Returns the inner BigInt as Arc (zero-copy) when this value is a boxed BigInt; None otherwise. Use Self::to_bigint to coerce from i64/f64/strings.

Source

pub fn to_bigint(&self) -> BigInt

Coerce any numeric value into a BigInt. Floats truncate. Used by arithmetic promotion paths under --compat when one side overflowed.

Source

pub fn float(f: f64) -> Self

Source

pub fn string(s: String) -> Self

Source

pub fn bytes(b: Arc<Vec<u8>>) -> Self

Source

pub fn array(v: Vec<StrykeValue>) -> Self

Source

pub fn iterator(it: Arc<dyn StrykeIterator>) -> Self

Wrap a lazy iterator as a StrykeValue.

Source

pub fn is_iterator(&self) -> bool

True when this value is a lazy iterator.

Source

pub fn into_iterator(&self) -> Arc<dyn StrykeIterator> โ“˜

Extract the iterator Arc (panics if not an iterator).

Source

pub fn hash(h: IndexMap<String, StrykeValue>) -> Self

Source

pub fn array_ref(a: Arc<RwLock<Vec<StrykeValue>>>) -> Self

Source

pub fn hash_ref(h: Arc<RwLock<IndexMap<String, StrykeValue>>>) -> Self

Source

pub fn scalar_ref(r: Arc<RwLock<StrykeValue>>) -> Self

Source

pub fn capture_cell(r: Arc<RwLock<StrykeValue>>) -> Self

Source

pub fn scalar_binding_ref(name: String) -> Self

Source

pub fn array_binding_ref(name: String) -> Self

Source

pub fn hash_binding_ref(name: String) -> Self

Source

pub fn code_ref(c: Arc<StrykeSub>) -> Self

Source

pub fn as_code_ref(&self) -> Option<Arc<StrykeSub>>

Source

pub fn as_regex(&self) -> Option<Arc<PerlCompiledRegex>>

Source

pub fn as_blessed_ref(&self) -> Option<Arc<BlessedRef>>

Source

pub fn hash_get(&self, key: &str) -> Option<StrykeValue>

Hash lookup when this value is a plain HeapObject::Hash (not a ref).

Source

pub fn is_undef(&self) -> bool

Source

pub fn is_simple_scalar(&self) -> bool

True for simple scalar values (integer, float, string, undef, bytes) that should be wrapped in ScalarRef for closure variable sharing. Complex heap objects like refs, blessed objects, code refs, etc. should NOT be wrapped because they already share state via Arc and wrapping breaks type detection.

Source

pub fn as_integer(&self) -> Option<i64>

Immediate int32 or heap Integer (not float / string).

Source

pub fn as_float(&self) -> Option<f64>

Source

pub fn as_array_vec(&self) -> Option<Vec<StrykeValue>>

Source

pub fn map_flatten_outputs(&self, peel_array_ref: bool) -> Vec<StrykeValue>

Expand a map / flat_map / pflat_map block result into list elements. Plain arrays expand; when peel_array_ref, a single ARRAY ref is dereferenced one level (stryke flat_map / pflat_map; stock map uses peel_array_ref == false).

Source

pub fn as_hash_map(&self) -> Option<IndexMap<String, StrykeValue>>

Source

pub fn as_bytes_arc(&self) -> Option<Arc<Vec<u8>>>

Source

pub fn as_async_task(&self) -> Option<Arc<StrykeAsyncTask>>

Source

pub fn as_generator(&self) -> Option<Arc<PerlGenerator>>

Source

pub fn as_atomic_arc(&self) -> Option<Arc<Mutex<StrykeValue>>>

Source

pub fn as_io_handle_name(&self) -> Option<String>

Source

pub fn as_sqlite_conn(&self) -> Option<Arc<Mutex<Connection>>>

Source

pub fn as_struct_inst(&self) -> Option<Arc<StructInstance>>

Source

pub fn as_enum_inst(&self) -> Option<Arc<EnumInstance>>

Source

pub fn as_class_inst(&self) -> Option<Arc<ClassInstance>>

Source

pub fn as_dataframe(&self) -> Option<Arc<Mutex<PerlDataFrame>>>

Source

pub fn as_deque(&self) -> Option<Arc<Mutex<VecDeque<StrykeValue>>>>

Source

pub fn as_heap_pq(&self) -> Option<Arc<Mutex<PerlHeap>>>

Source

pub fn as_pipeline(&self) -> Option<Arc<Mutex<PipelineInner>>>

Source

pub fn as_capture(&self) -> Option<Arc<CaptureResult>>

Source

pub fn as_ppool(&self) -> Option<PerlPpool>

Source

pub fn as_remote_cluster(&self) -> Option<Arc<RemoteCluster>>

Source

pub fn as_barrier(&self) -> Option<PerlBarrier>

Source

pub fn as_channel_tx(&self) -> Option<Arc<Sender<StrykeValue>>>

Source

pub fn as_channel_rx(&self) -> Option<Arc<Receiver<StrykeValue>>>

Source

pub fn as_scalar_ref(&self) -> Option<Arc<RwLock<StrykeValue>>>

Source

pub fn as_capture_cell(&self) -> Option<Arc<RwLock<StrykeValue>>>

Returns the inner Arc if this is a [HeapObject::CaptureCell].

Source

pub fn as_scalar_binding_name(&self) -> Option<String>

Name of the scalar slot for [HeapObject::ScalarBindingRef], if any.

Source

pub fn as_array_binding_name(&self) -> Option<String>

Stash-qualified array name for [HeapObject::ArrayBindingRef], if any.

Source

pub fn as_hash_binding_name(&self) -> Option<String>

Hash name for [HeapObject::HashBindingRef], if any.

Source

pub fn as_array_ref(&self) -> Option<Arc<RwLock<Vec<StrykeValue>>>>

Source

pub fn as_hash_ref(&self) -> Option<Arc<RwLock<IndexMap<String, StrykeValue>>>>

Source

pub fn is_mysync_deque_or_heap(&self) -> bool

mysync: deque / priority heap โ€” already Arc<Mutex<โ€ฆ>>.

Source

pub fn regex( rx: Arc<PerlCompiledRegex>, pattern_src: String, flags: String, ) -> Self

Source

pub fn regex_src_and_flags(&self) -> Option<(String, String)>

Pattern and flag string stored with a compiled regex (for =~ / [Op::RegexMatchDyn]).

Source

pub fn blessed(b: Arc<BlessedRef>) -> Self

Source

pub fn io_handle(name: String) -> Self

Source

pub fn atomic(a: Arc<Mutex<StrykeValue>>) -> Self

Source

pub fn set(s: Arc<PerlSet>) -> Self

Source

pub fn channel_tx(tx: Arc<Sender<StrykeValue>>) -> Self

Source

pub fn channel_rx(rx: Arc<Receiver<StrykeValue>>) -> Self

Source

pub fn async_task(t: Arc<StrykeAsyncTask>) -> Self

Source

pub fn generator(g: Arc<PerlGenerator>) -> Self

Source

pub fn deque(d: Arc<Mutex<VecDeque<StrykeValue>>>) -> Self

Source

pub fn heap(h: Arc<Mutex<PerlHeap>>) -> Self

Source

pub fn mutex() -> Self

Construct a fresh, unlocked [HeapObject::Mutex].

Source

pub fn semaphore(n: i64) -> Self

Construct a [HeapObject::Semaphore] with n permits (n is clamped to >= 0 by the caller โ€” see builtins_sync::semaphore_new).

Source

pub fn as_mutex(&self) -> Option<Arc<MutexHandle>>

Borrow-the-inner-handle accessor for [HeapObject::Mutex] (returns the Arc so the handle outlives the temporary StrykeValue).

Source

pub fn as_semaphore(&self) -> Option<Arc<SemaphoreHandle>>

Borrow-the-inner-handle accessor for [HeapObject::Semaphore].

Source

pub fn bloom_filter(b: Arc<Mutex<BloomFilter>>) -> Self

Source

pub fn as_bloom_filter(&self) -> Option<Arc<Mutex<BloomFilter>>>

Source

pub fn hll_sketch(h: Arc<Mutex<HllSketch>>) -> Self

Source

pub fn as_hll_sketch(&self) -> Option<Arc<Mutex<HllSketch>>>

Source

pub fn cms_sketch(c: Arc<Mutex<CmsSketch>>) -> Self

Source

pub fn as_cms_sketch(&self) -> Option<Arc<Mutex<CmsSketch>>>

Source

pub fn topk_sketch(t: Arc<Mutex<TopKSketch>>) -> Self

Source

pub fn as_topk_sketch(&self) -> Option<Arc<Mutex<TopKSketch>>>

Source

pub fn tdigest_sketch(t: Arc<Mutex<TDigestSketch>>) -> Self

Source

pub fn as_tdigest_sketch(&self) -> Option<Arc<Mutex<TDigestSketch>>>

Source

pub fn roaring_bitmap(r: Arc<Mutex<RoaringBitmapSketch>>) -> Self

Source

pub fn as_roaring_bitmap(&self) -> Option<Arc<Mutex<RoaringBitmapSketch>>>

Source

pub fn rate_limiter(r: Arc<Mutex<RateLimiterSketch>>) -> Self

Source

pub fn as_rate_limiter(&self) -> Option<Arc<Mutex<RateLimiterSketch>>>

Source

pub fn hash_ring(r: Arc<Mutex<HashRingSketch>>) -> Self

Source

pub fn as_hash_ring(&self) -> Option<Arc<Mutex<HashRingSketch>>>

Source

pub fn simhash(s: Arc<Mutex<SimHashSketch>>) -> Self

Source

pub fn as_simhash(&self) -> Option<Arc<Mutex<SimHashSketch>>>

Source

pub fn minhash(m: Arc<Mutex<MinHashSketch>>) -> Self

Source

pub fn as_minhash(&self) -> Option<Arc<Mutex<MinHashSketch>>>

Source

pub fn interval_tree(t: Arc<Mutex<IntervalTreeSketch>>) -> Self

Source

pub fn as_interval_tree(&self) -> Option<Arc<Mutex<IntervalTreeSketch>>>

Source

pub fn bk_tree(t: Arc<Mutex<BkTreeSketch>>) -> Self

Source

pub fn as_bk_tree(&self) -> Option<Arc<Mutex<BkTreeSketch>>>

Source

pub fn rope(r: Arc<Mutex<RopeSketch>>) -> Self

Source

pub fn as_rope(&self) -> Option<Arc<Mutex<RopeSketch>>>

Source

pub fn kv_store(k: Arc<Mutex<KvStore>>) -> Self

Source

pub fn as_kv_store(&self) -> Option<Arc<Mutex<KvStore>>>

Source

pub fn pipeline(p: Arc<Mutex<PipelineInner>>) -> Self

Source

pub fn capture(c: Arc<CaptureResult>) -> Self

Source

pub fn ppool(p: PerlPpool) -> Self

Source

pub fn remote_cluster(c: Arc<RemoteCluster>) -> Self

Source

pub fn barrier(b: PerlBarrier) -> Self

Source

pub fn sqlite_conn(c: Arc<Mutex<Connection>>) -> Self

Source

pub fn struct_inst(s: Arc<StructInstance>) -> Self

Source

pub fn enum_inst(e: Arc<EnumInstance>) -> Self

Source

pub fn class_inst(c: Arc<ClassInstance>) -> Self

Source

pub fn dataframe(df: Arc<Mutex<PerlDataFrame>>) -> Self

Source

pub fn errno_dual(code: i32, msg: String) -> Self

OS errno dualvar ($!) or eval-error dualvar ($@): to_int/to_number use code; string context uses msg.

Source

pub fn as_str(&self) -> Option<String>

Heap string payload, if any (allocates).

Source

pub fn append_to(&self, buf: &mut String)

Source

pub fn unwrap_atomic(&self) -> StrykeValue

Source

pub fn is_atomic(&self) -> bool

Source

pub fn is_true(&self) -> bool

Source

pub fn into_string(self) -> String

Source

pub fn as_str_or_empty(&self) -> String

Source

pub fn to_number(&self) -> f64

Source

pub fn to_int(&self) -> i64

Source

pub fn type_name(&self) -> String

Source

pub fn ref_type(&self) -> StrykeValue

Source

pub fn num_cmp(&self, other: &StrykeValue) -> Ordering

Source

pub fn str_eq(&self, other: &StrykeValue) -> bool

String equality for eq / cmp without allocating when both sides are heap strings.

Source

pub fn str_cmp(&self, other: &StrykeValue) -> Ordering

Source

pub fn struct_field_eq(&self, other: &StrykeValue) -> bool

Deep equality for struct fields (recursive).

Source

pub fn deep_clone(&self) -> StrykeValue

Deep clone a value (used for struct clone).

Source

pub fn to_list(&self) -> Vec<StrykeValue>

Source

pub fn scalar_context(&self) -> StrykeValue

Trait Implementationsยง

Sourceยง

impl Clone for StrykeValue

Sourceยง

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for StrykeValue

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl Default for StrykeValue

Sourceยง

fn default() -> Self

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl Display for StrykeValue

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl Drop for StrykeValue

Sourceยง

fn drop(&mut self)

Executes the destructor for this type. Read more
Sourceยง

fn pin_drop(self: Pin<&mut Self>)

๐Ÿ”ฌThis is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> ArchivePointee for T

Sourceยง

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Sourceยง

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Sourceยง

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Sourceยง

impl<T> DynClone for T
where T: Clone,

Sourceยง

fn __clone_box(&self, _: Private) -> *mut ()

Sourceยง

impl<T> Finish for T

Sourceยง

fn finish(self)

Does nothing but move self, equivalent to drop.
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> FromRef<T> for T
where T: Clone,

Sourceยง

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Sourceยง

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Sourceยง

impl<T> LayoutRaw for T

Sourceยง

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Sourceยง

impl<T> Pointable for T

Sourceยง

const ALIGN: usize

The alignment of pointer.
Sourceยง

type Init = T

The type for initializers.
Sourceยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Sourceยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Sourceยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Sourceยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Sourceยง

impl<T> Pointee for T

Sourceยง

type Metadata = ()

The type for metadata in pointers and references to Self.
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Sourceยง

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Sourceยง

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Sourceยง

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Sourceยง

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Sourceยง

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,