Skip to main content

_php_stream_wrapper

Struct _php_stream_wrapper 

Source
#[repr(C)]
pub struct _php_stream_wrapper { pub wops: *const php_stream_wrapper_ops, pub abstract_: *mut c_void, pub is_url: c_int, }

Fields§

§wops: *const php_stream_wrapper_ops§abstract_: *mut c_void§is_url: c_int

Implementations§

Source§

impl _php_stream_wrapper

Source

pub unsafe fn get<'a>(name: &str) -> Option<&'a Self>

Locates the stream wrapper registered for name.

§Safety

The returned wrapper is owned by PHP and lives in the per-request stream wrapper table, so the caller must not hold 'a beyond the current request. The lifetime is unconstrained by the arguments and must be chosen to reflect that.

Source

pub unsafe fn get_mut<'a>(name: &str) -> Option<&'a mut Self>

Locates the stream wrapper registered for name for mutation.

§Safety

In addition to the request-scoped validity required by Self::get, the caller must ensure no other reference to the same wrapper is live for 'a. The wrapper table is process-wide state shared with PHP and with every other extension, so this function cannot check exclusivity.

Source

pub fn register(self, name: &str) -> Result<Self, Error>

Register stream wrapper for name

§Errors
  • Error::StreamWrapperRegistrationFailure - If the stream wrapper could not be registered
  • Error::InvalidCString - If the name contains a NUL byte
Source

pub fn register_volatile(self, name: &str) -> Result<Self, Error>

Register volatile stream wrapper for name

§Errors
  • Error::StreamWrapperRegistrationFailure - If the stream wrapper could not be registered
Source

pub fn unregister(name: &str) -> Result<(), Error>

Unregister stream wrapper by name

§Errors
  • Error::StreamWrapperUnregistrationFailure - If the stream wrapper could not be unregistered
  • Error::InvalidCString - If the name contains a NUL byte
Source

pub fn unregister_volatile(name: &str) -> Result<(), Error>

Unregister volatile stream wrapper by name

§Errors
  • Error::StreamWrapperUnregistrationFailure - If the stream wrapper could not be unregistered
Source

pub fn wops(&self) -> &php_stream_wrapper_ops

Get the operations the stream wrapper can perform

Source

pub fn wops_mut(&mut self) -> &mut php_stream_wrapper_ops

Get the mutable operations the stream can perform

Trait Implementations§

Source§

impl Clone for _php_stream_wrapper

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 Copy for _php_stream_wrapper

Source§

impl Debug for _php_stream_wrapper

Source§

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

Formats the value using the given formatter. 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> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.