Type Alias StreamWrapper

Source
pub type StreamWrapper = php_stream_wrapper;
Expand description

Wrapper for PHP streams

Aliased Type§

#[repr(C)]
pub struct StreamWrapper { pub wops: *const _php_stream_wrapper_ops, pub abstract_: *mut c_void, pub is_url: i32, }

Fields§

§wops: *const _php_stream_wrapper_ops§abstract_: *mut c_void§is_url: i32

Implementations§

Source§

impl StreamWrapper

Source

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

Get wrapped stream by name

Source

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

Get mutable wrapped stream by name

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
§Panics
  • If the name cannot be converted to a C string
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
§Panics
  • If the name cannot be converted to a C string
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