pub struct GeneratedPort { /* private fields */ }Expand description
One generated Compose port entry with protocol-aware syntax selection.
Implementations§
Source§impl GeneratedPort
impl GeneratedPort
Sourcepub fn new(
target: u16,
published: Option<u16>,
host_ip: Option<String>,
protocol: GeneratedProtocol,
) -> Result<Self, GenerationError>
pub fn new( target: u16, published: Option<u16>, host_ip: Option<String>, protocol: GeneratedProtocol, ) -> Result<Self, GenerationError>
Creates a generated port without normalizing its declared transport.
§Errors
Rejects target port zero, an empty/NUL-bearing host address, and an SCTP host address
without a published port. SCTP uses Compose short syntax because the specification’s
long form only defines tcp and udp protocols.
Sourcepub const fn protocol(&self) -> GeneratedProtocol
pub const fn protocol(&self) -> GeneratedProtocol
Returns the transport protocol.
Trait Implementations§
Source§impl Clone for GeneratedPort
impl Clone for GeneratedPort
Source§fn clone(&self) -> GeneratedPort
fn clone(&self) -> GeneratedPort
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GeneratedPort
impl Debug for GeneratedPort
impl Eq for GeneratedPort
Source§impl PartialEq for GeneratedPort
impl PartialEq for GeneratedPort
impl StructuralPartialEq for GeneratedPort
Auto Trait Implementations§
impl Freeze for GeneratedPort
impl RefUnwindSafe for GeneratedPort
impl Send for GeneratedPort
impl Sync for GeneratedPort
impl Unpin for GeneratedPort
impl UnsafeUnpin for GeneratedPort
impl UnwindSafe for GeneratedPort
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