Struct janetrs::JanetSymbol [−][src]
#[repr(transparent)]pub struct JanetSymbol<'data> { /* fields omitted */ }
Expand description
Janet symbol type. Usually used to name things in Janet.
Implementations
impl JanetSymbol<'_>
[src]
impl JanetSymbol<'_>
[src]pub fn new(name: impl AsRef<[u8]>) -> Self
[src]
pub fn new(name: impl AsRef<[u8]>) -> Self
[src]Create a JanetSymbol
with given name
.
If the given name
is bigger than i32::MAX the generated symbol will have a name
trucated to that max size. That’s unrealistic thought.
Examples
use janetrs::JanetSymbol; let s = JanetSymbol::new("name");
pub fn unique() -> Self
[src]
pub fn unique() -> Self
[src]Generate a unique Janet symbol. This is used in the library function gensym. The symbol will be of the format _XXXXXX, where X is a base64 digit, and prefix is the argument passed. No prefix for speed.
Examples
use janetrs::JanetSymbol; let s = JanetSymbol::unique();
pub const unsafe fn from_raw(raw: *const u8) -> Self
[src]
pub const unsafe fn from_raw(raw: *const u8) -> Self
[src]Create a new JanetSymbol
with a raw
pointer.
Safety
This function do not check if the given raw
is NULL
or not. Use at your
own risk.
pub fn len(&self) -> i32
[src]
pub fn len(&self) -> i32
[src]Returns the length of this JanetSymbol
, in bytes, not char
s or graphemes.
In other words, it may not be what a human considers the length of the string.
Examples
use janetrs::JanetSymbol; let s = JanetSymbol::new("name"); assert_eq!(s.len(), 4);
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
[src]Returns true
if this JanetSymbol
has a length of zero, and false
otherwise.
Examples
use janetrs::JanetSymbol; let s = JanetSymbol::new("name"); assert!(!s.is_empty());
Trait Implementations
impl Clone for JanetSymbol<'_>
[src]
impl Clone for JanetSymbol<'_>
[src]impl Debug for JanetSymbol<'_>
[src]
impl Debug for JanetSymbol<'_>
[src]impl Display for JanetSymbol<'_>
[src]
impl Display for JanetSymbol<'_>
[src]impl From<&'_ JanetBuffer<'_>> for JanetSymbol<'_>
[src]
impl From<&'_ JanetBuffer<'_>> for JanetSymbol<'_>
[src]fn from(buff: &JanetBuffer<'_>) -> Self
[src]
fn from(buff: &JanetBuffer<'_>) -> Self
[src]Performs the conversion.
impl From<&'_ JanetKeyword<'_>> for JanetSymbol<'_>
[src]
impl From<&'_ JanetKeyword<'_>> for JanetSymbol<'_>
[src]fn from(key: &JanetKeyword<'_>) -> Self
[src]
fn from(key: &JanetKeyword<'_>) -> Self
[src]Performs the conversion.
impl From<&'_ JanetString<'_>> for JanetSymbol<'_>
[src]
impl From<&'_ JanetString<'_>> for JanetSymbol<'_>
[src]fn from(string: &JanetString<'_>) -> Self
[src]
fn from(string: &JanetString<'_>) -> Self
[src]Performs the conversion.
impl From<&'_ JanetSymbol<'_>> for JanetBuffer<'_>
[src]
impl From<&'_ JanetSymbol<'_>> for JanetBuffer<'_>
[src]fn from(s: &JanetSymbol<'_>) -> Self
[src]
fn from(s: &JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl From<&'_ JanetSymbol<'_>> for JanetString<'_>
[src]
impl From<&'_ JanetSymbol<'_>> for JanetString<'_>
[src]fn from(sym: &JanetSymbol<'_>) -> Self
[src]
fn from(sym: &JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl From<&'_ JanetSymbol<'_>> for JanetKeyword<'_>
[src]
impl From<&'_ JanetSymbol<'_>> for JanetKeyword<'_>
[src]fn from(sym: &JanetSymbol<'_>) -> Self
[src]
fn from(sym: &JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl From<&'_ JanetSymbol<'_>> for Janet
[src]
impl From<&'_ JanetSymbol<'_>> for Janet
[src]fn from(val: &JanetSymbol<'_>) -> Self
[src]
fn from(val: &JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl From<&'_ str> for JanetSymbol<'_>
[src]
impl From<&'_ str> for JanetSymbol<'_>
[src]impl From<JanetBuffer<'_>> for JanetSymbol<'_>
[src]
impl From<JanetBuffer<'_>> for JanetSymbol<'_>
[src]fn from(buff: JanetBuffer<'_>) -> Self
[src]
fn from(buff: JanetBuffer<'_>) -> Self
[src]Performs the conversion.
impl From<JanetKeyword<'_>> for JanetSymbol<'_>
[src]
impl From<JanetKeyword<'_>> for JanetSymbol<'_>
[src]fn from(key: JanetKeyword<'_>) -> Self
[src]
fn from(key: JanetKeyword<'_>) -> Self
[src]Performs the conversion.
impl From<JanetString<'_>> for JanetSymbol<'_>
[src]
impl From<JanetString<'_>> for JanetSymbol<'_>
[src]fn from(string: JanetString<'_>) -> Self
[src]
fn from(string: JanetString<'_>) -> Self
[src]Performs the conversion.
impl From<JanetSymbol<'_>> for JanetBuffer<'_>
[src]
impl From<JanetSymbol<'_>> for JanetBuffer<'_>
[src]fn from(s: JanetSymbol<'_>) -> Self
[src]
fn from(s: JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl From<JanetSymbol<'_>> for JanetString<'_>
[src]
impl From<JanetSymbol<'_>> for JanetString<'_>
[src]fn from(sym: JanetSymbol<'_>) -> Self
[src]
fn from(sym: JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl From<JanetSymbol<'_>> for JanetKeyword<'_>
[src]
impl From<JanetSymbol<'_>> for JanetKeyword<'_>
[src]fn from(sym: JanetSymbol<'_>) -> Self
[src]
fn from(sym: JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl From<JanetSymbol<'_>> for Janet
[src]
impl From<JanetSymbol<'_>> for Janet
[src]fn from(val: JanetSymbol<'_>) -> Self
[src]
fn from(val: JanetSymbol<'_>) -> Self
[src]Performs the conversion.
impl FromStr for JanetSymbol<'_>
[src]
impl FromStr for JanetSymbol<'_>
[src]impl Ord for JanetSymbol<'_>
[src]
impl Ord for JanetSymbol<'_>
[src]impl<'a, 'b> PartialEq<&'a BStr> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialEq<&'a BStr> for JanetSymbol<'_>
[src]impl<'a, 'b> PartialEq<&'a BString> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialEq<&'a BString> for JanetSymbol<'_>
[src]impl<'a, 'b> PartialEq<&'a str> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialEq<&'a str> for JanetSymbol<'_>
[src]impl<'a, 'b> PartialEq<BStr> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialEq<BStr> for JanetSymbol<'_>
[src]impl<'a, 'b> PartialEq<BString> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialEq<BString> for JanetSymbol<'_>
[src]impl PartialEq<JanetKeyword<'_>> for JanetSymbol<'_>
[src]
impl PartialEq<JanetKeyword<'_>> for JanetSymbol<'_>
[src]impl PartialEq<JanetString<'_>> for JanetSymbol<'_>
[src]
impl PartialEq<JanetString<'_>> for JanetSymbol<'_>
[src]impl PartialEq<JanetSymbol<'_>> for JanetSymbol<'_>
[src]
impl PartialEq<JanetSymbol<'_>> for JanetSymbol<'_>
[src]impl PartialEq<JanetSymbol<'_>> for JanetString<'_>
[src]
impl PartialEq<JanetSymbol<'_>> for JanetString<'_>
[src]impl PartialEq<JanetSymbol<'_>> for JanetKeyword<'_>
[src]
impl PartialEq<JanetSymbol<'_>> for JanetKeyword<'_>
[src]impl<'a, 'b> PartialEq<String> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialEq<String> for JanetSymbol<'_>
[src]impl<'a, 'b> PartialEq<str> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialEq<str> for JanetSymbol<'_>
[src]impl<'a, 'b> PartialOrd<&'a [u8]> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<&'a [u8]> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &&'a [u8]) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &&'a [u8]) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'a BStr> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<&'a BStr> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &&'a BStr) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &&'a BStr) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'a BString> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<&'a BString> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &&'a BString) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &&'a BString) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'a str> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<&'a str> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<[u8]> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<[u8]> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<BStr> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<BString> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<BString> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &BString) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &BString) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<JanetKeyword<'_>> for JanetSymbol<'_>
[src]
impl PartialOrd<JanetKeyword<'_>> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &JanetKeyword<'_>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &JanetKeyword<'_>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<JanetString<'_>> for JanetSymbol<'_>
[src]
impl PartialOrd<JanetString<'_>> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &JanetString<'_>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &JanetString<'_>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<JanetSymbol<'_>> for JanetSymbol<'_>
[src]
impl PartialOrd<JanetSymbol<'_>> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<JanetSymbol<'_>> for JanetString<'_>
[src]
impl PartialOrd<JanetSymbol<'_>> for JanetString<'_>
[src]fn partial_cmp(&self, other: &JanetSymbol<'_>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &JanetSymbol<'_>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<JanetSymbol<'_>> for JanetKeyword<'_>
[src]
impl PartialOrd<JanetSymbol<'_>> for JanetKeyword<'_>
[src]fn partial_cmp(&self, other: &JanetSymbol<'_>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &JanetSymbol<'_>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<String> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<String> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Vec<u8, Global>> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<Vec<u8, Global>> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &Vec<u8>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Vec<u8>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<str> for JanetSymbol<'_>
[src]
impl<'a, 'b> PartialOrd<str> for JanetSymbol<'_>
[src]fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl TryFrom<Janet> for JanetSymbol<'_>
[src]
impl TryFrom<Janet> for JanetSymbol<'_>
[src]impl Eq for JanetSymbol<'_>
[src]
Auto Trait Implementations
impl<'data> RefUnwindSafe for JanetSymbol<'data>
impl<'data> !Send for JanetSymbol<'data>
impl<'data> !Sync for JanetSymbol<'data>
impl<'data> Unpin for JanetSymbol<'data>
impl<'data> UnwindSafe for JanetSymbol<'data>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more