Which categories are injective with respect to fully faithful functors? Recall that a poset $K$ is a complete lattice if and only if $K$ is injective with respect to poset embeddings in that sense that for any poset $B$, any embedded subposet $A \subseteq B$, and any order-preserving map $A \to K$, there exists an extension $B \to K$.
I'm wondering what sorts of generalizations or analogs this fact has when passing from posets to categories. Ultimately I'd be interested to know if (co)completeness conditions can be characterized by injectivity, but I'm not sure what the correct question is in this direction, so let's start with something concrete:
Question: Which locally small categories $\mathcal K$ are injective with respect to fully faithful functors $\mathcal A \to \mathcal B$ between small categories?
There is some ambiguity about what "injective" means here. In general, "injective with respect to fully faithful functors" means that given a fully faithful functor $\mathcal A \to \mathcal B$ and a functor $\mathcal A \to \mathcal K$, there exists a functor $\mathcal B \to \mathcal K$ making the requisite diagram commute. But I can think of at least 4 possible meanings of "commute" -- we could ask for the diagram to commute strictly (giving (1) "strict-injectivity"), up to isomorphism (giving (2) "pseudo-injectivity"), or up to a natural transformation (giving (3) "lax-injectivity" or (4) "oplax-injectivity" depending on the direction of the transformation). So really there are at least 4 questions here. I think the most interesting versions are the "strict" and "pseudo" versions, and I suspect the answers in these two cases should be rather close.
Notes:

*

*At any rate, it seems that by duality, the answer can't be "the complete categories" except perhaps in case (3) or (4).


*If it makes a difference to change from considering fully faithful functors $\mathcal A \to \mathcal B$ to just considering full replete subcategories $\mathcal A \subseteq \mathcal B$ or something like that, I'd be happy with an answer to any such small variation.


*I would also be interested in knowing the answer when considering fully faithful functors between locally small categories, rather than just between small categories.
 A: There's a nice answer if we take a slightly stronger notion of "injectivity", namely where we take Kan extensions instead of extensions. I would expect this to coincide in some nice cases with the non-Kan notion of injectivity.
This is a question for which the theory of (co)KZ doctrines is well-suited, in which (co)completeness properties are characterised by the existence of certain extensions. I'll choose to work with KZ doctrines, and thus cocompleteness properties. A good reference is Walker's Distributive laws via admissibility, and the full definitions of the various concepts I make use of below can be found there.
Let $(\mathbb P, \eta)$ be a KZ doctrine on a 2-category $\mathcal K$. An object $X \in \mathcal K$ is $\mathbb P$-cocomplete if for all $g \colon B \to X$, there exists a left extension $\mathrm{lan}_{\eta_B} g$, exhibited by an invertible 2-cell,

such that the left extension respects those defined by the KZ doctrine in an appropriate sense (q.uiver link).
From Marmolejo–Wood's Kan extensions and lax idempotent pseudomonads, we know that the $\mathbb P$-cocomplete objects are equivalently the pseudoalgebras for the pseudomonad $\mathbf P \colon \mathcal K \to \mathcal K$ induced by $(\mathbb P, \eta)$, so that when we take $\mathbf P$ to be a pseudomonad for a cocompletion under a class of weights $\Phi$, then $\mathbb P$-cocompleteness corresponds to admitting all $\Phi$-colimits. In particular, for $\mathbb P$ the small presheaf construction on locally small categories, a $\mathbb P$-cocomplete object is just a small-cocomplete locally small category.
To relate this to your question, we also need to introduce the notion of admissibility for a KZ doctrine. A 1-cell $f \colon A \to B$ is $\mathbb P$-admissible if, for any $h \colon A \to X$ for $X$ a $\mathbb P$-cocomplete object, there exists a left extension $\mathrm{lan}_f h$,

such that the left extension is preserved by $\mathbb P$-cocontinuous 1-cells into any  $\mathbb P$-cocomplete object (q.uiver link).
Crucially, as Walker observes in Remark 25 ibid., a $\mathbb P$-admissible 1-cell is $\mathbb P$-fully faithful (meaning $\mathbf Pf$ is representably fully faithful) if and only if every left extension as in the diagram above is exhibited by an invertible 2-cell.
Taking $\mathbb P$ to be the small presheaf construction, the $\mathbb P$-admissible 1-cells are the functors $f \colon A \to B$ for which $B(f{-}, b)$ is a small presheaf for all $b \in B$. We shall call these small functors. (Ivan Di Liberti mentions several equivalent conditions for a functor to be small in this answer.) The $\mathbb P$-fully faithful 1-cells are precisely the fully faithful functors. So, if a locally small category $X$ is small-cocomplete, every functor $A \to X$ admits a left extension along small functors $A \to B$ (hence $X$ is "Kan lax-injective" with respect to small functors). Furthermore, these left extensions are exhibited by invertible 2-cells precisely for those small functors $A \to B$ that are fully faithful (hence $X$ is "Kan pseudo-injective" with respect to small fully faithful functors).
Conversely, if a locally small category $X$ admits left extensions of functors $A \to X$ along small functors, it in particular admits a left extension along the Yoneda embedding of $A$ (since the unit $\eta$ of a KZ doctrine is $\mathbb P$-admissible), and hence is small-cocomplete. Therefore, the locally small categories that are Kan lax-injective with respect to small functors are precisely the small-cocomplete categories.
One question remains, which regards the case when $X$ is only known to admits left extensions along $\mathbb P$-fully faithful $\mathbb P$-admissible 1-cells. Here, we may restrict our consideration to the fully faithful KZ doctrines, which are those for which the components of the unit $\eta_B \colon B \to \mathbb P B$ are representably fully faithful. In this case, $X$ once again admits extensions along $\eta_B$, and hence is $\mathbb P$-cocomplete. Since the Yoneda embedding is fully faithful, the small presheaf construction is a fully faithful KZ doctrine. Therefore, the locally small categories that are Kan pseudo-injective with respect to small fully faithful functors are precisely the small-cocomplete categories.
(Let me know if something doesn't quite look right – I could well have made a mistake somewhere along the line!)
A: Here is a partial answer, which is maybe closer to a slightly different generalization from the poset case. In light of Chris Schommer-Pries' comment and answer, I've tried to match up levels of strictness appropriately. As noted in the proof of Lemma 2, the proof there is rather fiddly (and in particular does not immediately generalize to the $\infty$-categorical case) and it is possible I have made a mistake, so caveat lector!

Claim: Let $\mathcal K$ be an accessible category. Then $\mathcal K$ is strictly injective with respect to full subcategory inclusions (equivalently: injective-on-objects, fully faithful functors) between small categories if and only if $\mathcal K$ is locally presentable.
Corollary: Let $\mathcal K$ be an accessible category. Then $\mathcal K$ is pseudo-injective with respect to fully faithful functors between small categories if and only if $\mathcal K$ is locally presentable.
Corollary: In the $(2,1)$-category $Acc$ of accessible categories and accessible functors, the pseudo-injective objects with respect to the fully faithful accessible functors are precisely the locally presentable categories.

Recall than an accessible category is complete iff it is cocomplete iff it is locally presentable. Recall than an accessible category is complete iff it is cocomplete iff it is locally presentable. The last statement provides a direct generalization of the case of posets, where instead of generalizing posets to categories, we generalize posets to accessible categories.

The proof of the claim will use the following lemmas. If $J$ is a category, let $J^\triangleright$ denote the cocone on $J$-- i.e. $J$ with a terminal object freely adjoined. Let $\infty \in J^\triangleright$ denote the cone point. Note that we have a canonical full subcategory inclusion $J \to J^\triangleright$. Similarly, $I^\triangleleft$ is $I$ with a free initial object $-\infty$ adjoined.
Lemma 1: Let $\mathcal K$ be an accessible category. Suppose that $\mathcal K$ is strictly injective with respect to the inclusion $J \to J^\triangleright$ for each small $J$. Then $\mathcal K$ has a terminal object.
Proof: Write $\mathcal K = Ind_\kappa(\mathcal K_\kappa)$, where $\mathcal K_\kappa$ is small. By hypothesis, the canonical inclusion $\mathcal K_\kappa \to \mathcal K$ has an extension along $\mathcal K_\kappa \to \mathcal (K_\kappa)^\triangleright$. Since the inclusion $\mathcal K_\kappa \to \mathcal K$ is cofinal, this implies that there is a cocone on the identity functor $\mathcal K \to \mathcal K$. Since $\mathcal K$ has split idempotents, it follows that $\mathcal K$ has a terminal object.
Lemma 2: Let $J$ be a category, and let $I$ be either a discrete category, or the walking cospan $I = \bullet \to \bullet \leftarrow \bullet$. Then the canonical functor $(I^\triangleleft \times J) \cup_{I \times J} (I \times J^\triangleright) \to I^\triangleleft \times J^\triangleright$ is fully faithful and injective on objects.
Proof: The thing to show is that if $i \in I$ and $j \in J$, then there is a unique map $(-\infty,j) \to (i,\infty)$ in the pushout category. I do not see a better way to do this than case-by-case analysis, and it is possible I have missed something. I don't believe this lemma holds for arbitrary $I$.
Proof of Claim: In one direction, if $\mathcal K$ is complete, then it is injective via Kan extensions as noted by Gregory Arone in the comments. Conversely, suppose that $\mathcal K$ is accessible and injective; we wish to show that $\mathcal K$ is complete, or equivalently that $\mathcal K$ has products and pullbacks.  That is, if $I$ is either discrete or the walking cospan $I = \bullet \to \bullet \leftarrow \bullet$ and $F: I \to \mathcal K$, we wish to show that $\mathcal K^{I^\triangleleft} \times_{\mathcal K^I} \{F\}$ has a terminal object. Since this category is accessible, it will suffice by Lemma 1 to show that it is injective with respect to $J \to J^{\triangleright}$ for all small $J$. It will suffice to show that $\mathcal K^{I^\triangleleft} \to \mathcal K^I$ has the right lifting property with respect to such functors. By the usual currying/uncurrying manipulations, this is equivalent to showing that $\mathcal K$ is injective with respect to the functor $(I^\triangleleft \times J) \cup_{I \times J} (I \times J^\triangleright) \to I^\triangleleft \times J^\triangleright$. This follows from Lemma 2 and the hypothesis that $\mathcal K$ is injective.
A: I will focus on the strictly injective case.
Claim: The only strictly injective categories are the posets which are complete lattices.
The strict injective property requires that you have the lifting property against fully-faithful functors. By looking various examples I will show that this puts further and further restrictions on your injective category until we ultimately conclude it is a poset.
Step 1: Isomorphisms are identities.
Let $J$ be the free-walking isomorphism (the contractible category on two objects). Let $pt$ be the terminal category. The functor $J \to pt$ is fully-faithful. Therefore if $\mathcal{K}$ is injective, any functor $J \to \mathcal{K}$ (i.e. an isomorphism) factors $J \to pt \to \mathcal{K}$. Thus all isomorphisms are actually identities. In particular all automorphism in $\mathcal{K}$ are trivial.
Step 2: Parallel arrows are equal.
Let $\partial C_2$ be the free-walking pair of parallel arrows. It has two objects $a$ and $b$ and there are two arrows from $a$ to $b$; all other arrows are identities.
Consider the following category $\mathcal{B}$. It has three objects $a$, $q$, and $b$, and it is generated by three morphisms $g: a \to q$, $f: q \to b$, and $x: q \to q$. There is one relation $x^2 = id_q$.
There are no morphisms from $q$ to $a$, nor from $b$ to either $a$ or $q$. There are exactly two from $a$ to $b$: $fg$ and $fxg$. There is an evident fully-faithful inclusion $\partial C_2 \to \mathcal{B}$, sending the parallel arrows to $fg$ and $fxg$.
Thus every pair of parallel arrows $\partial C_2 \to \mathcal{K}$ factors through a map $\partial C_2 \to \mathcal{B} \to \mathcal{K}$. But since all isomorphisms in $\mathcal{K}$ are identities, the morphism $x$ gets mapped to an identity. So then $fg$ and $fxg$ are mapped to the same arrow in $\mathcal{K}$.
Thus there are no distinct parallel arrows in $\mathcal{K}$.
Step 3: Endomorphisms are trivial.
Let $\mathbb{N}$ be the natural numbers viewed as a one-object category. It is the free-waling endomorphism. We are going to find a fully-faithful embedding of $\mathbb{N}$ into another category $\mathcal{C}$, which we now describe.
The category $\mathcal{C}$ has two objects $a$ and $b$, and it is generated by three morphisms $f, f': a \to b$, and $g: b \to a$. There is one relation: $f' \circ g = id_b$.
The endomorphisms of $b$ are isomorphic to $\mathbb{N}$ and are generated by $fg$.  This gives a fully-faithful inclusion $\mathbb{N} \to \mathcal{C}$ taking the unique object of $\mathbb{N}$ to $b$.
A functor $\mathbb{N} \to \mathcal{K}$ corresponds to an object of $\mathcal{K}$ with an endomorphism of that object. If $\mathcal{K}$ is injective, then this must factor as $\mathbb{N} \to \mathcal{C} \to \mathcal{K}$. However any parallel pair of arrows in $\mathcal{K}$ are actually the same arrow. Thus $f$ and $f'$ map to the same arrow, and hence $gf$ is mapped to $gf' = id_b$.
So any endomorphism of an object in $\mathcal{K}$ is actually an identity.
Conclusion
Since there are no parallel arrows, no non-identity isomorphisms, and no non-identity endomorphisms in $\mathcal{K}$, it is a poset.
As observed in the OP, injectivity it property against embeddings of posets forces $\mathcal{K}$ to be a complete lattice. It is also not hard to see that that if $\mathcal{A} \to \mathcal{B}$ is fully-faithful, then its reflection into posets is an embedding. So then a complete lattice will also be injective when viewed as a category.
