[−][src]Struct libuv::buf::Buf
Buffer data type.
Implementations
impl Buf
[src]
pub fn new(s: &str) -> Result<Buf, Box<dyn Error>>
[src]
Create a new Buf with the given string
pub fn new_from_bytes(bytes: &[u8]) -> Result<Buf, Box<dyn Error>>
[src]
Create a new Buf from the given byte slice
pub fn with_capacity(size: usize) -> Result<Buf>
[src]
Create a Buf with the given capacity - the memory is not initialized
pub fn new_from(other: &impl BufTrait, size: Option<usize>) -> Result<Self>
[src]
Create a duplicate of this Buf - if the optional size parameter is None, the new Buf will have the same size as the existing Buf. Otherwise, the new Buf will have the specified size and data up to that size, or the size of the original buf, whichever is lower, will be copied.
pub fn is_allocated(&self) -> bool
[src]
Returns true if the internal buffer is initialized
pub fn resize(&mut self, size: usize) -> Result<()>
[src]
Resizes the internal buffer
pub fn copy_from(&mut self, other: &impl BufTrait) -> Result<()>
[src]
Copies the data from a Buf to this one.
pub fn dealloc(&mut self)
[src]
Deallocate the internal buffer, but leave the Buf intact.
pub fn destroy(&mut self)
[src]
Deallocates the internal buffer and the Buf
Trait Implementations
impl BufTrait for Buf
[src]
fn readonly(&self) -> ReadonlyBuf
[src]
impl Clone for Buf
[src]
impl Copy for Buf
[src]
impl From<Buf> for ReadonlyBuf
[src]
fn from(buf: Buf) -> ReadonlyBuf
[src]
impl<'_> TryFrom<&'_ str> for Buf
[src]
Auto Trait Implementations
impl RefUnwindSafe for Buf
impl !Send for Buf
impl !Sync for Buf
impl Unpin for Buf
impl UnwindSafe for Buf
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,