pub struct GlBufferHandle { /* private fields */ }Expand description
GL buffer object (GLuint) + binding metadata.
Implementations§
Source§impl GlBufferHandle
impl GlBufferHandle
Sourcepub unsafe fn try_from_raw(
name: u32,
target: GlBufferTarget,
size: u64,
context: *mut c_void,
share_group: Option<u64>,
keep_alive: Option<KeepAlive>,
) -> Result<Self, InvalidHandleError>
pub unsafe fn try_from_raw( name: u32, target: GlBufferTarget, size: u64, context: *mut c_void, share_group: Option<u64>, keep_alive: Option<KeepAlive>, ) -> Result<Self, InvalidHandleError>
Wrap a GL buffer-object name plus its binding metadata. Borrowing:
the handle is stored non-owningly, this type has no Drop, and
every obligation below extends to each Clone.
§Safety
namemust be a buffer-object name live incontext’s share group, andtargetits actual binding target.sizemust not exceed the buffer’s real store size in bytes — consumers read and write[0, size)through it. Zero is rejected asInvalidHandleError::ZeroSizeandname == 0asInvalidHandleError::NullHandle; neither is a caller obligation.- The
context == nullmeaning, theshare_groupobligation, the thread-affinity assertion and the lifetime rule (no retain, noDrop, noglDeleteBufferswhile anyCloneis reachable) are exactly those ofGlTextureHandle::try_from_raw.
pub fn name(&self) -> u32
pub fn target(&self) -> GlBufferTarget
pub fn size(&self) -> u64
pub fn context(&self) -> *mut c_void
pub fn keep_alive(&self) -> Option<&KeepAlive>
Trait Implementations§
Source§impl Clone for GlBufferHandle
impl Clone for GlBufferHandle
Source§impl Debug for GlBufferHandle
impl Debug for GlBufferHandle
impl Send for GlBufferHandle
impl Sync for GlBufferHandle
Auto Trait Implementations§
impl !RefUnwindSafe for GlBufferHandle
impl !UnwindSafe for GlBufferHandle
impl Freeze for GlBufferHandle
impl Unpin for GlBufferHandle
impl UnsafeUnpin for GlBufferHandle
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