remove as_ptr()

Signed-off-by: Walker Crouse <Walker.Crouse@coop.co.uk>
This commit is contained in:
Walker Crouse 2020-09-28 12:38:26 -04:00
parent 35e5d00bb4
commit 97ad8097e0
2 changed files with 2 additions and 7 deletions

View File

@ -100,7 +100,7 @@ impl BonjourMdnsService {
let txt_record = self
.txt_record
.as_ref()
.map(|t| t.as_ptr())
.map(|t| t.0.get_bytes_ptr())
.unwrap_or_null();
self.service.lock().unwrap().register_service(

View File

@ -8,7 +8,7 @@ use std::{mem, ptr};
/// Interface for interfacting with Bonjour's TXT record capabilities.
#[derive(Debug)]
pub struct BonjourTxtRecord(ManagedTXTRecordRef);
pub struct BonjourTxtRecord(pub(crate) ManagedTXTRecordRef);
impl BonjourTxtRecord {
/// Constructs a new TXT recoord
@ -87,11 +87,6 @@ impl BonjourTxtRecord {
Box::new(Values(Iter::new(self)))
}
/// Returns a raw pointer to the underlying TXT data.
pub fn as_ptr(&self) -> *const c_void {
self.0.get_bytes_ptr()
}
/// Returns the size of the raw bytes in the TXT record.
pub fn size(&self) -> u16 {
self.0.get_length()