Struct objc2_foundation::NSURLProtocol
source · #[repr(C)]pub struct NSURLProtocol { /* private fields */ }
Available on crate feature
NSURLProtocol
only.Implementations§
source§impl NSURLProtocol
impl NSURLProtocol
pub unsafe fn initWithRequest_cachedResponse_client( this: Allocated<Self>, request: &NSURLRequest, cached_response: Option<&NSCachedURLResponse>, client: Option<&ProtocolObject<dyn NSURLProtocolClient>> ) -> Retained<Self>
Available on crate features
NSURLCache
and NSURLRequest
only.pub unsafe fn client( &self ) -> Option<Retained<ProtocolObject<dyn NSURLProtocolClient>>>
pub unsafe fn request(&self) -> Retained<NSURLRequest>
Available on crate feature
NSURLRequest
only.pub unsafe fn cachedResponse(&self) -> Option<Retained<NSCachedURLResponse>>
Available on crate feature
NSURLCache
only.pub unsafe fn canInitWithRequest(request: &NSURLRequest) -> bool
Available on crate feature
NSURLRequest
only.pub unsafe fn canonicalRequestForRequest( request: &NSURLRequest ) -> Retained<NSURLRequest>
Available on crate feature
NSURLRequest
only.pub unsafe fn requestIsCacheEquivalent_toRequest( a: &NSURLRequest, b: &NSURLRequest ) -> bool
Available on crate feature
NSURLRequest
only.pub unsafe fn startLoading(&self)
pub unsafe fn stopLoading(&self)
pub unsafe fn propertyForKey_inRequest( key: &NSString, request: &NSURLRequest ) -> Option<Retained<AnyObject>>
Available on crate features
NSString
and NSURLRequest
only.pub unsafe fn setProperty_forKey_inRequest( value: &AnyObject, key: &NSString, request: &NSMutableURLRequest )
Available on crate features
NSString
and NSURLRequest
only.pub unsafe fn removePropertyForKey_inRequest( key: &NSString, request: &NSMutableURLRequest )
Available on crate features
NSString
and NSURLRequest
only.pub unsafe fn registerClass(protocol_class: &AnyClass) -> bool
pub unsafe fn unregisterClass(protocol_class: &AnyClass)
source§impl NSURLProtocol
impl NSURLProtocol
Methods declared on superclass NSObject
source§impl NSURLProtocol
impl NSURLProtocol
NSURLSessionTaskAdditions
pub unsafe fn canInitWithTask(task: &NSURLSessionTask) -> bool
Available on crate feature
NSURLSession
only.pub unsafe fn initWithTask_cachedResponse_client( this: Allocated<Self>, task: &NSURLSessionTask, cached_response: Option<&NSCachedURLResponse>, client: Option<&ProtocolObject<dyn NSURLProtocolClient>> ) -> Retained<Self>
Available on crate features
NSURLCache
and NSURLSession
only.pub unsafe fn task(&self) -> Option<Retained<NSURLSessionTask>>
Available on crate feature
NSURLSession
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl AsMut<AnyObject> for NSURLProtocol
impl AsMut<AnyObject> for NSURLProtocol
source§impl AsMut<NSObject> for NSURLProtocol
impl AsMut<NSObject> for NSURLProtocol
source§impl AsMut<NSURLProtocol> for NSURLProtocol
impl AsMut<NSURLProtocol> for NSURLProtocol
source§impl AsRef<AnyObject> for NSURLProtocol
impl AsRef<AnyObject> for NSURLProtocol
source§impl AsRef<NSObject> for NSURLProtocol
impl AsRef<NSObject> for NSURLProtocol
source§impl AsRef<NSURLProtocol> for NSURLProtocol
impl AsRef<NSURLProtocol> for NSURLProtocol
source§impl Borrow<AnyObject> for NSURLProtocol
impl Borrow<AnyObject> for NSURLProtocol
source§impl Borrow<NSObject> for NSURLProtocol
impl Borrow<NSObject> for NSURLProtocol
source§impl BorrowMut<AnyObject> for NSURLProtocol
impl BorrowMut<AnyObject> for NSURLProtocol
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for NSURLProtocol
impl BorrowMut<NSObject> for NSURLProtocol
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl ClassType for NSURLProtocol
impl ClassType for NSURLProtocol
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSURLProtocol"
const NAME: &'static str = "NSURLProtocol"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl Debug for NSURLProtocol
impl Debug for NSURLProtocol
source§impl Deref for NSURLProtocol
impl Deref for NSURLProtocol
source§impl DerefMut for NSURLProtocol
impl DerefMut for NSURLProtocol
source§impl Hash for NSURLProtocol
impl Hash for NSURLProtocol
source§impl NSObjectProtocol for NSURLProtocol
impl NSObjectProtocol for NSURLProtocol
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl PartialEq for NSURLProtocol
impl PartialEq for NSURLProtocol
source§fn eq(&self, other: &NSURLProtocol) -> bool
fn eq(&self, other: &NSURLProtocol) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSURLProtocol
impl RefEncode for NSURLProtocol
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for NSURLProtocol
impl Message for NSURLProtocol
impl StructuralPartialEq for NSURLProtocol
Auto Trait Implementations§
impl !Freeze for NSURLProtocol
impl !RefUnwindSafe for NSURLProtocol
impl !Send for NSURLProtocol
impl !Sync for NSURLProtocol
impl !Unpin for NSURLProtocol
impl !UnwindSafe for NSURLProtocol
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more