Skip to main content

BStr

Struct BStr 

Source
pub struct BStr<'pool> { /* private fields */ }
Expand description

Borrowed view of an SVN string tied to pool lifetime

Implementations§

Source§

impl<'pool> BStr<'pool>

Source

pub fn from_raw(ptr: *const svn_string_t) -> Self

Create from raw SVN string pointer

Source

pub fn from_bytes(data: &[u8], pool: &'pool Pool<'pool>) -> Self

Create SVN string in pool from bytes

Source

pub fn from_str(s: &str, pool: &'pool Pool<'pool>) -> Self

Create SVN string in pool from str

Source

pub fn as_ptr(&self) -> *const svn_string_t

Gets the raw pointer to the SVN string.

Source

pub fn as_mut_ptr(&mut self) -> *mut svn_string_t

Gets a mutable raw pointer to the SVN string.

Source

pub fn as_bytes(&self) -> &[u8]

Get bytes as slice

Source

pub fn to_bytes(&self) -> Vec<u8>

Convert to owned Vec<u8>

Source

pub fn as_str(&self) -> Result<&str, Utf8Error>

Try to interpret as UTF-8 string

Source

pub fn to_string_lossy(&self) -> String

Convert to owned String, replacing invalid UTF-8

Auto Trait Implementations§

§

impl<'pool> Freeze for BStr<'pool>

§

impl<'pool> RefUnwindSafe for BStr<'pool>

§

impl<'pool> !Send for BStr<'pool>

§

impl<'pool> !Sync for BStr<'pool>

§

impl<'pool> Unpin for BStr<'pool>

§

impl<'pool> UnsafeUnpin for BStr<'pool>

§

impl<'pool> UnwindSafe for BStr<'pool>

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> 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, 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.