/// Creates a new IPv4 packet builder without options.
Creates a new IPv4 packet builder without options.
Creates a new IPv4 packet builder without options .
pub fn new<T: IntoIterator<Item = I::Item, IntoIter = I>>(
        prefix_builder: Ipv4PacketBuilder,
        options: T,
    ) -> Option<Ipv4PacketBuilderWithOptions<'a, I>> {
        let options = OptionSequenceBuilder::new(options.into_iter());
        // The maximum header length for IPv4 packet is 60 bytes, minus the fixed 40 bytes,
        // we only have 40 bytes for options.
        if options.serialized_len() > MAX_OPTIONS_LEN {
            return None;
        }
        Some(Ipv4PacketBuilderWithOptions { prefix_builder, options })
    }
pub fn new < T : IntoIterator < Item = I :: Item , IntoIter = I > > ( prefix_builder : Ipv4PacketBuilder , options : T , ) -> Option < Ipv4PacketBuilderWithOptions < ' a , I > > { let options = OptionSequenceBuilder :: new ( options . into_iter ( ) ) ; // The maximum header length for IPv4 packet is 60 bytes, minus the fixed 40 bytes, // we only have 40 bytes for options. if options . serialized_len ( ) > MAX_OPTIONS_LEN { return None ; } Some ( Ipv4PacketBuilderWithOptions { prefix_builder , options } ) }
Creates a new IPv4 packet builder without options.
Creates a new IPv4 packet builder without options .
prefix_builder
Ipv4PacketBuilder
options
T