markdown.Link
type pub inline enum LinkA type describing the kind of link something is.
Constructors
Direct
Direct(String)A direct link, such as [text](link here).
Reference
Reference(String)A reference link, such as [text][reference-name]
Instance methods
!=
Show source codeHide source code
fn pub !=(other: ref Self) -> Bool {
(self == other).false?
}fn pub !=(other: ref Self) -> BoolReturns true if self and the given object are not equal to each other.
==
Show source codeHide source code
fn pub ==(other: ref Link) -> Bool {
match (self, other) {
case (Direct(a), Direct(b)) -> a == b
case (Reference(a), Reference(b)) -> a == b
case _ -> false
}
}fn pub ==(other: ref Link) -> BoolReturns true if self and the given object are equal to each other.
This operator is used to perform structural equality. This means two objects residing in different memory locations may be considered equal, provided their structure is equal. For example, two different arrays may be considered to have structural equality if they contain the exact same values.
clone
Show source codeHide source code
fn pub clone -> Link {
match self {
case Direct(v) -> Link.Direct(v)
case Reference(v) -> Link.Reference(v)
}
}fn pub clone -> LinkCreates a clone of self.
The returned value is an owned value that is the same type as the receiver
of this method. For example, cloning a ref Array[Int] results in a
Array[Int], not another ref Array[Int].
fmt
Show source codeHide source code
fn pub fmt(formatter: mut Formatter) {
match self {
case Direct(val) -> formatter.tuple('Direct').field(val).finish
case Reference(val) -> formatter.tuple('Reference').field(val).finish
}
}fn pub fmt(formatter: mut Formatter)Formats self in a human-readable format for debugging purposes.
Implemented traits
Clone
impl Clone for LinkEqual
impl Equal for LinkFormat
impl Format for Link