pub fn serialize<W: Write>(&self, w: &mut W, id: u16) -> io::Result<()> {
        let dhaddr = MacAddr::new(0, 0, 0, 0, 0, 0);
        let dsaddr = SocketAddr::V4(SocketAddrV4::new(
            Ipv4Addr::new(0, 0, 0, 0), 0));

        let haddr = self.mac()
            .unwrap_or(&dhaddr);
        let saddr = self.address()
            .unwrap_or(&dsaddr);

        let header = ServiceHeader::new(id, self.type_id(), haddr, saddr);

        try!(header.serialize(w));

        if let Some(path) = self.path() {
            try!(w.write_all(path.as_bytes()));
        }

        w.write_all(&[0u8])
    }
/// Serialize this Service Table item in-place.
Serialize this Service Table item in-place.
Serialize this Service Table item in - place .
pub fn serialize<W: Write>(&self, w: &mut W, id: u16) -> io::Result<()> {
        let dhaddr = MacAddr::new(0, 0, 0, 0, 0, 0);
        let dsaddr = SocketAddr::V4(SocketAddrV4::new(
            Ipv4Addr::new(0, 0, 0, 0), 0));
        let haddr = self.mac()
            .unwrap_or(&dhaddr);
        let saddr = self.address()
            .unwrap_or(&dsaddr);
        let header = ServiceHeader::new(id, self.type_id(), haddr, saddr);
        try!(header.serialize(w));
        if let Some(path) = self.path() {
            try!(w.write_all(path.as_bytes()));
        }
        w.write_all(&[0u8])
    }
pub fn serialize < W : Write > ( & self , w : & mut W , id : u16 ) -> io :: Result < ( ) > { let dhaddr = MacAddr :: new ( 0 , 0 , 0 , 0 , 0 , 0 ) ; let dsaddr = SocketAddr :: V4 ( SocketAddrV4 :: new ( Ipv4Addr :: new ( 0 , 0 , 0 , 0 ) , 0 ) ) ; let haddr = self . mac ( ) . unwrap_or ( & dhaddr ) ; let saddr = self . address ( ) . unwrap_or ( & dsaddr ) ; let header = ServiceHeader :: new ( id , self . type_id ( ) , haddr , saddr ) ; try ! ( header serialize ( w ) ) ; if let Some ( path ) = self . path ( ) { try ! ( w write_all ( path as_bytes ( ) ) ) ; } w . write_all ( & [ 0u8 ] ) }
Serialize this Service Table item in-place.
Serialize this Service Table item in - place .
&self
w
&mut W
id
u16
&self
w
&mut W
id
u16