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: i32Implementations§
Source§impl StreamWrapper
impl StreamWrapper
Sourcepub unsafe fn get<'a>(name: &str) -> Option<&'a Self>
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.
Sourcepub unsafe fn get_mut<'a>(name: &str) -> Option<&'a mut Self>
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.
Sourcepub fn register(self, name: &str) -> Result<Self, Error>
pub fn register(self, name: &str) -> Result<Self, Error>
Register stream wrapper for name
§Errors
Error::StreamWrapperRegistrationFailure- If the stream wrapper could not be registeredError::InvalidCString- If the name contains a NUL byte
Sourcepub fn register_volatile(self, name: &str) -> Result<Self, Error>
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
Sourcepub fn unregister(name: &str) -> Result<(), Error>
pub fn unregister(name: &str) -> Result<(), Error>
Unregister stream wrapper by name
§Errors
Error::StreamWrapperUnregistrationFailure- If the stream wrapper could not be unregisteredError::InvalidCString- If the name contains a NUL byte
Sourcepub fn unregister_volatile(name: &str) -> Result<(), Error>
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
Sourcepub fn wops(&self) -> &php_stream_wrapper_ops
pub fn wops(&self) -> &php_stream_wrapper_ops
Get the operations the stream wrapper can perform
Sourcepub fn wops_mut(&mut self) -> &mut php_stream_wrapper_ops
pub fn wops_mut(&mut self) -> &mut php_stream_wrapper_ops
Get the mutable operations the stream can perform