Struct PtrRef

Source
pub struct PtrRef(/* private fields */);
Expand description

References a pointer from the host.

It could be casted to any type, although you should only cast if you are sure of the type of cast.

From<T> implementations are used to turn a rust value to a host pointer. It allocates the value in the host.

Into<T> implementations are used to convert a host’s value pointer to a rust type.

Implementations§

Source§

impl PtrRef

Source

pub fn new(ptr: i32) -> Self

Source

pub fn pointer(&self) -> i32

Source

pub fn kind(&self) -> Kind

Source

pub fn is_none(&self) -> bool

Source

pub fn is_some(&self) -> bool

Source

pub fn as_string(&self) -> Result<String>

Source

pub fn as_object(self) -> Result<ObjectRef>

Source

pub fn as_array(self) -> Result<ArrayRef>

Source

pub fn as_int(&self) -> Result<i64>

Source

pub fn as_float(&self) -> Result<f64>

Source

pub fn as_bool(&self) -> Result<bool>

Source

pub fn as_node(&self) -> Result<Node>

Cast the ValueRef to a Node.

Trait Implementations§

Source§

impl Clone for PtrRef

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PtrRef

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for PtrRef

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<&str> for PtrRef

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<DiscoverListing> for PtrRef

Source§

fn from(value: DiscoverListing) -> Self

Converts to this type from the input type.
Source§

impl From<DiscoverListings> for PtrRef

Source§

fn from(value: DiscoverListings) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Paging<T>> for PtrRef
where PtrRef: From<T>,

Source§

fn from(value: Paging<T>) -> Self

Converts to this type from the input type.
Source§

impl From<Playlist> for PtrRef

Source§

fn from(value: Playlist) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistDetails> for PtrRef

Source§

fn from(value: PlaylistDetails) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistEpisodeServer> for PtrRef

Source§

fn from(value: PlaylistEpisodeServer) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistEpisodeServerLink> for PtrRef

Source§

fn from(value: PlaylistEpisodeServerLink) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistEpisodeServerResponse> for PtrRef

Source§

fn from(value: PlaylistEpisodeServerResponse) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistEpisodeServerSkipTime> for PtrRef

Source§

fn from(value: PlaylistEpisodeServerSkipTime) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistEpisodeServerSubtitle> for PtrRef

Source§

fn from(value: PlaylistEpisodeServerSubtitle) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistEpisodeSource> for PtrRef

Source§

fn from(value: PlaylistEpisodeSource) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistEpisodeSources> for PtrRef

Source§

fn from(value: PlaylistEpisodeSources) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistGroup> for PtrRef

Source§

fn from(value: PlaylistGroup) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistGroupContent> for PtrRef

Source§

fn from(value: PlaylistGroupContent) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistGroupPage> for PtrRef

Source§

fn from(value: PlaylistGroupPage) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistItem> for PtrRef

Source§

fn from(value: PlaylistItem) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistItemsResponse> for PtrRef

Source§

fn from(value: PlaylistItemsResponse) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistPreview> for PtrRef

Source§

fn from(value: PlaylistPreview) -> Self

Converts to this type from the input type.
Source§

impl From<PtrRef> for ArrayRef

Source§

fn from(ptr: PtrRef) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Result<T, MochiError>> for PtrRef
where PtrRef: From<T>,

Source§

fn from(value: Result<T>) -> Self

Converts to this type from the input type.
Source§

impl From<SearchFilter> for PtrRef

Source§

fn from(value: SearchFilter) -> Self

Converts to this type from the input type.
Source§

impl From<SearchFilterOption> for PtrRef

Source§

fn from(value: SearchFilterOption) -> Self

Converts to this type from the input type.
Source§

impl From<SearchFilters> for PtrRef

Source§

fn from(value: SearchFilters) -> PtrRef

Converts to this type from the input type.
Source§

impl From<String> for PtrRef

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for PtrRef

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for PtrRef

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for PtrRef

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for PtrRef

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for PtrRef

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<PtrRef> for ArrayRef

Source§

fn from_iter<T: IntoIterator<Item = PtrRef>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl Into<PlaylistEpisodeServerRequest> for PtrRef

Source§

fn into(self) -> PlaylistEpisodeServerRequest

Converts this type into the (usually inferred) input type.
Source§

impl Into<PlaylistEpisodeSourcesRequest> for PtrRef

Source§

fn into(self) -> PlaylistEpisodeSourcesRequest

Converts this type into the (usually inferred) input type.
Source§

impl Into<PlaylistItemsRequest> for PtrRef

Source§

fn into(self) -> PlaylistItemsRequest

Converts this type into the (usually inferred) input type.
Source§

impl Into<SearchQuery> for PtrRef

Source§

fn into(self) -> SearchQuery

Converts this type into the (usually inferred) input type.
Source§

impl Into<String> for PtrRef

Source§

fn into(self) -> String

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

§

impl Freeze for PtrRef

§

impl RefUnwindSafe for PtrRef

§

impl Send for PtrRef

§

impl Sync for PtrRef

§

impl Unpin for PtrRef

§

impl UnwindSafe for PtrRef

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.