Skip to main content

ZString

Type Alias ZString 

Source
pub type ZString = EBox<ZStr>;
Expand description

An owned PHP string value.

ZString represents an owned PHP string (zend_string) allocated in the Zend Engine memory. It provides safe access to PHP string operations and automatically manages memory cleanup using reference counting.

Aliased Type§

pub struct ZString { /* private fields */ }

Implementations§

Source§

impl ZString

Source

pub fn new(s: impl AsRef<[u8]>) -> Self

Creates a new zend string from a container of bytes.

Source

pub fn new_persistent(s: impl AsRef<[u8]>) -> Self

Creates a new persistent zend string from a container of bytes.

Trait Implementations§

Source§

impl AsRef<[u8]> for ZString

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for ZString

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<Rhs: AsRef<[u8]>> PartialEq<Rhs> for ZString

Source§

fn eq(&self, other: &Rhs) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.